aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2022-10-30 08:16:40 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2022-10-30 08:16:40 +0200
commit8a968daaae4e16cee641bee868227de45bd4c8c0 (patch)
tree14e96569a8e0dd0c8bc0cdcf915cdc883e7e2b12 /Software/Visual_Studio/Tango.Touch
parentf59383fb9ca4b7b70b1f60953b8c7de983b60eb5 (diff)
downloadTango-8a968daaae4e16cee641bee868227de45bd4c8c0.tar.gz
Tango-8a968daaae4e16cee641bee868227de45bd4c8c0.zip
Visual Fine Tuning
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchNumericUpDownConrol.cs19
-rw-r--r--Software/Visual_Studio/Tango.Touch/Styles/TouchNumericUpDownControl.xaml2
2 files changed, 16 insertions, 5 deletions
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); }
+ }
+
+ /// <summary>
+ /// The slider minimum value property
+ /// </summary>
+ 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 @@
</RepeatButton>
<controls:TouchNumericTextBox x:Name="Number_PART" Margin="50 4 0 0" FontSize="{StaticResource TangoMessageBoxMessageFontSize}" HorizontalContentAlignment="Center" VerticalAlignment="Center" BorderBrush="{TemplateBinding BorderBrush}" VerticalContentAlignment="Center" UpdateBindingOnlyWhenFocused="True"
- 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"/>
+ 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"/>
<RepeatButton Background="Transparent" Height="40" Margin="50 0 0 0" Padding="2" Style="{StaticResource emptyButton}" Command="{Binding Path=IncrementCommand,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=controls:TouchNumericUpDownConrol}, Mode=TwoWay}" VerticalAlignment="Center">