diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 18fb0726f..ad185f1a3 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -117,7 +117,14 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty UpdateBindingOnlyWhenFocusedProperty = DependencyProperty.Register("UpdateBindingOnlyWhenFocused", typeof(bool), typeof(TouchNumericTextBox), new PropertyMetadata(false)); - + public virtual bool HasError + { + get + { + return Validation.GetHasError(this); + } + } + public override void OnApplyTemplate() { @@ -161,13 +168,16 @@ namespace Tango.Touch.Controls value = Math.Round(value, 0); } - if (value < Minimum) - { - value = Minimum; - } - else if (value > Maximum) + if (Maximum > Minimum) { - value = Maximum; + if (value < Minimum) + { + value = Minimum; + } + else if (value > Maximum) + { + value = Maximum; + } } } |
