Exemple #1
0
 public ViewModel()
 {
     SelectedColor    = new ColorModel();
     PropertyChanged += (sender, args) =>
     {
         if (args.PropertyName == nameof(SelectedColor))
         {
             deleteColorCommand.RaiseCanExecuteChanged();
             addColorCommand.RaiseCanExecuteChanged();
         }
     };
     addColorCommand    = new DelegateCommand(AddSelectedColor, () => colors.Contains(SelectedColor) == false);
     deleteColorCommand = new DelegateCommand(RemoveSelectedColor /*, /*()=>colors.Contains(SelectedColor) == true*/);
 }