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()); }
private void Validate() { FilterState = QueryPart.Validate(Context); }