code_junkie

ValidationRule To Enforce Unique Name

Nov 10th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. class YourCollectionType : DependencyObject {
  2.  
  3. [PROPERTY DEPENDENCY OF ObservableCollection<YourType> NAMED: BoundList]
  4.  
  5. }
  6.  
  7. YourCollectionType ListToCheck { get; set; }
  8.  
  9. <Binding.ValidationRules>
  10. <YourValidationRule>
  11. <YourValidationRule.ListToCheck>
  12. <YourCollectionType BoundList="{Binding Path=TheCollectionYouWantToCheck}" />
  13. </YourValidationRule.ListToCheck>
  14. </YourValidationRule>
  15. </Binding.ValidationRules>
Add Comment
Please, Sign In to add comment