diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-23 13:33:53 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2023-03-23 13:33:53 +0200 |
| commit | 0766ff8488c961c7f73eec50fb9ee64c89da5eb1 (patch) | |
| tree | d3c5ea5015571f085ac7da513ed34e4c68937acf /Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | |
| parent | 3283eca8d5cb327779d53b6e1744e3440098bb35 (diff) | |
| download | Tango-0766ff8488c961c7f73eec50fb9ee64c89da5eb1.tar.gz Tango-0766ff8488c961c7f73eec50fb9ee64c89da5eb1.zip | |
Eureka. PPC. Job View changes. Basic mode. Summary view.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 15c516124..47b3670a7 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -112,6 +112,17 @@ namespace Tango.Touch.Controls } public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register("Maximum", typeof(double), typeof(TouchNumericTextBox), new PropertyMetadata(null)); + + public double Step + { + get { return (double)GetValue(StepProperty); } + set { SetValue(StepProperty, value); } + } + + public static readonly DependencyProperty StepProperty = + DependencyProperty.Register("Step", typeof(double), typeof(TouchNumericTextBox), new PropertyMetadata(null)); + + public double JoggingFactor { @@ -198,6 +209,14 @@ namespace Tango.Touch.Controls { value = Math.Round(value, 0); } + if (Step > 0) + { + value = Math.Round(value / Step, MidpointRounding.AwayFromZero) * Step; + } + if(Minimum > 0 && value < Minimum) + { + value = Minimum; + } if (Maximum > Minimum) { @@ -209,6 +228,7 @@ namespace Tango.Touch.Controls { value = Maximum; } + } } |
