Add TickUp/DownCommand dps to VolSurfaceCellView

This commit is contained in:
John Colvin committed 2022-01-23 15:25:41 -05:00
1 parent 568d9da42f
commit b3bc3ca18d
3 files changed
+25 -1

No files matched your search

@@ -78,7 +78,9 @@
<c:TickUpDown
x:Name="candidate_view"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
Visibility="Hidden">
Visibility="Hidden"
TickDownCommand="{Binding TickDownCommand, RelativeSource={RelativeSource TemplatedParent}}"
TickUpCommand="{Binding TickUpCommand, RelativeSource={RelativeSource TemplatedParent}}">
<TextBox
Text="{Binding CandidateValue, RelativeSource={RelativeSource TemplatedParent}, UpdateSourceTrigger=Explicit}"
FontFamily="{TemplateBinding FontFamily}"
@@ -95,6 +95,26 @@ namespace mbts.ui.controls {
}
#endregion
#region TickDownCommand
public static readonly DependencyProperty TickDownCommandProperty =
WPFHelper.create_dp<ICommand, VolSurfaceCellView>(nameof(TickDownCommand));
public ICommand TickDownCommand {
get => GetValue(TickDownCommandProperty) as ICommand;
set => SetValue(TickDownCommandProperty, value);
}
#endregion
#region TickUpCommand
public static readonly DependencyProperty TickUpCommandProperty =
WPFHelper.create_dp<ICommand, VolSurfaceCellView>(nameof(TickUpCommand));
public ICommand TickUpCommand {
get => GetValue(TickUpCommandProperty) as ICommand;
set => SetValue(TickUpCommandProperty, value);
}
#endregion
#region IsDirty
public static readonly DependencyPropertyKey IsDirtyPropertyKey =
DependencyProperty.RegisterReadOnly(nameof(IsDirty), typeof(bool), typeof(VolSurfaceCellView),
@@ -92,6 +92,8 @@ namespace mbts.spark.VolSurface {
Converter = ValueConverter.create<bool, Brush>(is_dirty =>
is_dirty ? BTSColors.UI.input_dirty_border.to_brush() : Brushes.Transparent)
});
view.SetBinding(VolSurfaceCellView.TickDownCommandProperty, new Binding(nameof(VolGridTickCellVM.tick_down_cmd)));
view.SetBinding(VolSurfaceCellView.TickUpCommandProperty, new Binding(nameof(VolGridTickCellVM.tick_up_cmd)));
return view;
}
default: