From 8a968daaae4e16cee641bee868227de45bd4c8c0 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Sun, 30 Oct 2022 08:16:40 +0200 Subject: Visual Fine Tuning --- .../Tango.Touch/Controls/TouchNumericUpDownConrol.cs | 19 +++++++++++++++---- .../Tango.Touch/Styles/TouchNumericUpDownControl.xaml | 2 +- 2 files changed, 16 insertions(+), 5 deletions(-) (limited to 'Software/Visual_Studio/Tango.Touch') diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs index 2b85e8168..d12dd27b6 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs @@ -60,6 +60,17 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty MaxValueProperty = DependencyProperty.Register("MaxValue", typeof(double), typeof(TouchNumericUpDownConrol), new PropertyMetadata(100.0)); + public double Step + { + get { return (double)GetValue(StepProperty); } + set { SetValue(StepProperty, value); } + } + + /// + /// The slider minimum value property + /// + public static readonly DependencyProperty StepProperty = + DependencyProperty.Register("Step", typeof(double), typeof(TouchNumericUpDownConrol), new PropertyMetadata(1.0)); public double NumericPartWidth @@ -105,11 +116,11 @@ namespace Tango.Touch.Controls { IncrementCommand = new RelayCommand(()=> { - Value += 1; - } , (x)=> { return (Value + 1) <= MaxValue; }); + Value += Step; + } , (x)=> { return (Value + Step) <= MaxValue; }); DecrementCommand = new RelayCommand(() => { - Value -= 1; - }, (x) => { return (Value - 1) >= MinValue; }); + Value -= Step; + }, (x) => { return (Value - Step) >= MinValue; }); _changedFromAnotherControl = false; } diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml index 961b22c0f..d29cd2a48 100644 --- a/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml @@ -82,7 +82,7 @@ + Value="{Binding Value,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" Minimum="{Binding MinValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}}" Maximum="{Binding MaxValue,RelativeSource={RelativeSource AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" HideUnderline="True" HasDecimalPoint="True"/> -- cgit v1.3.1