order ticket - 'size' commit on enter

This commit is contained in:
John Colvin committed 2018-03-27 20:05:12 -04:00
1 parent 4cfa7b0ccf
commit f337146a4d
3 files changed
+8 -1

No files matched your search

@@ -83,6 +83,7 @@
Grid.Row="2"
Grid.ColumnSpan="2"
usp:OrderModificationControl.IsDirty="{Binding size_dirty, FallbackValue={x:Null}}"
CommitOnEnter="True"
Focusable="False"
Value="{Binding size_calculator.value}"
/>
@@ -171,6 +171,7 @@
<ControlTemplate TargetType="c:TickUpDownNullableUInt">
<c:TickUpDown x:Name="PART_tick_up_down">
<TextBox
u:TextBoxBehavior.CommitOnEnter="{TemplateBinding CommitOnEnter}"
u:TextBoxBehavior.EnableArrowKeyTraverse="True"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
@@ -18,7 +18,12 @@ namespace mbts.ui.controls {
new PropertyMetadata(0u));
public uint TickDefaultValue { get => (uint)GetValue(TickDefaultValueProperty); set => SetValue(TickDefaultValueProperty, value); }
public override void OnApplyTemplate() {
public static readonly DependencyProperty CommitOnEnterProperty = DependencyProperty.Register(
nameof(CommitOnEnter), typeof(bool), typeof(TickUpDownNullableUInt), new PropertyMetadata(false));
public bool CommitOnEnter { get => (bool)GetValue(CommitOnEnterProperty); set => SetValue(CommitOnEnterProperty, value); }
public override void OnApplyTemplate() {
var tick_up_down = this.assert_template_child<TickUpDown>("PART_tick_up_down");
tick_up_down.TickUpCommand = new DelegateCommand(_tick_up);
tick_up_down.TickDownCommand = new DelegateCommand(_tick_down);