diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/IDataGridColumnFilter.cs b/src/client/spark/view/Controls/DataGridEx/Filters/IDataGridColumnFilter.cs index 7bc90c669..c5f7cc125 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/IDataGridColumnFilter.cs +++ b/src/client/spark/view/Controls/DataGridEx/Filters/IDataGridColumnFilter.cs @@ -7,7 +7,7 @@ namespace mbts.spark.filters { string prop_name { get; } bool? active { get; } bool open { get; } - ICommand commit { get; } + ICommand apply { get; } ICommand clear { get; } ICommand cancel { get; } bool filter(TRow row); diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/VM/FilterVMBase.cs b/src/client/spark/view/Controls/DataGridEx/Filters/VM/FilterVMBase.cs index 5d444eb52..f3ad470ed 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/VM/FilterVMBase.cs +++ b/src/client/spark/view/Controls/DataGridEx/Filters/VM/FilterVMBase.cs @@ -14,7 +14,7 @@ namespace mbts.spark.filters { this.prop_name = prop_name; _active = backing(nameof(active), () => HasErrors ? new bool?() : _get_active()); _snapshot = detect_property_changes(); - commit = new DelegateCommand(_commit); + apply = new DelegateCommand(_apply); cancel = new DelegateCommand(_cancel); clear = new DelegateCommand(_clear); } @@ -26,7 +26,7 @@ namespace mbts.spark.filters { public bool? active => _active.Value; public bool open { get; set; } public bool filter(TRow row) => _filter(_get_row_val(row)); - public ICommand commit { get; } + public ICommand apply { get; } public ICommand cancel { get; } public ICommand clear { get; } @@ -41,7 +41,7 @@ namespace mbts.spark.filters { protected abstract bool _get_active(); protected abstract bool _filter(TValue value); protected abstract void _load_state_internal(TState state); - protected virtual void _commit() { + protected virtual void _apply() { request_clear_focus?.Invoke((true, true)); Disposable.dispose(ref _snapshot); _snapshot = detect_property_changes(); diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/VM/TupleFilterVM.cs b/src/client/spark/view/Controls/DataGridEx/Filters/VM/TupleFilterVM.cs index 655bcb6c7..6977c97e0 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/VM/TupleFilterVM.cs +++ b/src/client/spark/view/Controls/DataGridEx/Filters/VM/TupleFilterVM.cs @@ -44,7 +44,7 @@ namespace mbts.spark.filters { } } public bool open { get; set; } - public ICommand commit { get; } + public ICommand apply { get; } public ICommand clear { get; } public ICommand cancel { get; } diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml b/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml index e95720fa7..24525e3e8 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml +++ b/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml @@ -16,7 +16,7 @@ - + diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml.cs b/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml.cs index f77e5507f..5f120a29c 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml.cs +++ b/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterContentControl.xaml.cs @@ -13,24 +13,30 @@ namespace mbts.ui.spark { public FilterContentControl() => WPFHelper.listen_for_clear_focus_requests(this); - public static readonly DependencyProperty CommitCommandProperty = DependencyProperty.Register( - nameof(CommitCommand), typeof(ICommand), typeof(FilterContentControl)); + #region ApplyCommand + public static readonly DependencyProperty ApplyCommandProperty = DependencyProperty.Register( + nameof(ApplyCommand), typeof(ICommand), typeof(FilterContentControl)); - public ICommand CommitCommand { get => GetValue(CommitCommandProperty) as ICommand; set => SetValue(CommitCommandProperty, value); } + public ICommand ApplyCommand { get => GetValue(ApplyCommandProperty) as ICommand; set => SetValue(ApplyCommandProperty, value); } + #endregion + #region ClearCommand public static readonly DependencyProperty ClearCommandProperty = DependencyProperty.Register( nameof(ClearCommand), typeof(ICommand), typeof(FilterContentControl)); public ICommand ClearCommand { get => GetValue(ClearCommandProperty) as ICommand; set => SetValue(ClearCommandProperty, value); } + #endregion + #region CancelCommand public static readonly DependencyProperty CancelCommandProperty = DependencyProperty.Register( nameof(CancelCommand), typeof(ICommand), typeof(FilterContentControl)); public ICommand CancelCommand { get => GetValue(CancelCommandProperty) as ICommand; set => SetValue(CancelCommandProperty, value); } + #endregion protected override void OnPreviewKeyDown(KeyEventArgs e) { if (e.Key == Key.Enter) - CommitCommand.TryExecuteIfCan(null); + ApplyCommand.TryExecuteIfCan(null); } } } \ No newline at end of file diff --git a/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterTemplates.xaml b/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterTemplates.xaml index 01869e5ce..af16edca7 100644 --- a/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterTemplates.xaml +++ b/src/client/spark/view/Controls/DataGridEx/Filters/Views/FilterTemplates.xaml @@ -18,7 +18,7 @@ 160 - + - + - + - + - + - + - +