示例#1
0
 private FilterBoxViewModel(IValidationScope context, bool negate, QueryPartViewModel queryPart)
 {
     this.Context                  = context;
     this.queryPart                = queryPart;
     queryPart.PropertyChanged    += (sender, args) => RaiseChanged();
     queryPart.ReadyModeRequested += (sender, args) => Validate();
     state         = FilterBoxState.Editing;
     this.negate   = negate;
     this.last     = false;
     AddCommand    = new RelayCommand <QueryPartSuggestion>(suggestion => Added?.Invoke(this, suggestion));
     DeleteCommand = new RelayCommand(() => Deleted?.Invoke(this, new EventArgs()));
     DoneCommand   = new RelayCommand(() => Validate());
 }
示例#2
0
 private void Validate()
 {
     FilterState = QueryPart.Validate(Context);
 }