SPARK-653/SPARK-679 Rename 'Commit' to 'Apply'

This commit is contained in:
John Colvin committed 2018-03-18 13:05:24 -04:00
1 parent c5a69bc637
commit 1a88d99aed
6 files changed
+23 -17

No files matched your search

@@ -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);
@@ -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();
@@ -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; }
@@ -16,7 +16,7 @@
<ContentPresenter Margin="{TemplateBinding Padding}"/>
<Border Grid.Row="1" Background="{x:Static u:BTSColors.dialog_skirt_brush}" HorizontalAlignment="Stretch" Padding="10,8">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Command="{TemplateBinding CommitCommand}" IsDefault="True" Focusable="False" Style="{StaticResource CommonButton}">Commit</Button>
<Button Command="{TemplateBinding ApplyCommand}" IsDefault="True" Focusable="False" Style="{StaticResource CommonButton}">Apply</Button>
<Button Margin="8,0,0,0" Command="{TemplateBinding ClearCommand}" Focusable="False" Style="{StaticResource CommonButton}">Clear</Button>
</StackPanel>
</Border>
@@ -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);
}
}
}
@@ -18,7 +18,7 @@
</ResourceDictionary.MergedDictionaries>
<sys:Double x:Key="MinMaxWidth">160</sys:Double>
<DataTemplate x:Key="DoubleMinMaxTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:DoubleMinMaxFilterControl
Minimum="{Binding minimum}"
Maximum="{Binding maximum}"
@@ -28,7 +28,7 @@
</usp:FilterContentControl>
</DataTemplate>
<DataTemplate x:Key="IntMinMaxTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:IntMinMaxFilterControl
Minimum="{Binding minimum}"
Maximum="{Binding maximum}"
@@ -38,7 +38,7 @@
</usp:FilterContentControl>
</DataTemplate>
<DataTemplate x:Key="UIntMinMaxTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:UIntMinMaxFilterControl
Minimum="{Binding minimum}"
Maximum="{Binding maximum}"
@@ -48,7 +48,7 @@
</usp:FilterContentControl>
</DataTemplate>
<DataTemplate x:Key="UShortMinMaxTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:UShortMinMaxFilterControl
Minimum="{Binding minimum}"
Maximum="{Binding maximum}"
@@ -58,7 +58,7 @@
</usp:FilterContentControl>
</DataTemplate>
<DataTemplate x:Key="ULongMinMaxTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:ULongMinMaxFilterControl
Minimum="{Binding minimum}"
Maximum="{Binding maximum}"
@@ -68,7 +68,7 @@
</usp:FilterContentControl>
</DataTemplate>
<DataTemplate x:Key="TimeFilterTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<c:TimeFilterControl
Mode="{Binding mode}"
Begin="{Binding begin}"
@@ -94,7 +94,7 @@
/>
</DataTemplate>
<DataTemplate x:Key="RegexTemplate">
<usp:FilterContentControl CommitCommand="{Binding commit}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<usp:FilterContentControl ApplyCommand="{Binding apply}" ClearCommand="{Binding clear}" CancelCommand="{Binding cancel}">
<Grid Width="160">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>