diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-25 18:43:45 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-06-25 18:43:45 +0300 |
| commit | 9d5a18e590d7f892076a14d835962df5076d0172 (patch) | |
| tree | fed842264ddbed9b359900be343a1f13d826ae6e /Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | |
| parent | 7b9f2f35b722f316ba37bed9f35216c0211159ec (diff) | |
| download | Tango-9d5a18e590d7f892076a14d835962df5076d0172.tar.gz Tango-9d5a18e590d7f892076a14d835962df5076d0172.zip | |
Working on PPC
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 941cb392a..1453a38a6 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -121,18 +121,21 @@ namespace Tango.Touch.Controls { double value = (double)e; - if (!HasDecimalPoint) + if (_text_box != null) //Min and max not being set yet... { - value = Math.Round(value, 0); - } + if (!HasDecimalPoint) + { + value = Math.Round(value, 0); + } - if (value < Minimum) - { - value = Minimum; - } - else if (value > Maximum) - { - value = Maximum; + if (value < Minimum) + { + value = Minimum; + } + else if (value > Maximum) + { + value = Maximum; + } } return value; @@ -168,17 +171,18 @@ namespace Tango.Touch.Controls if (StringFormat != null) { _text_block.Text = Value.ToString(StringFormat); + _text_box.Text = Value.ToString(StringFormat); } else { _text_block.Text = Value.ToString(); } - } - BindingExpression b = GetBindingExpression(ValueProperty); - if (b != null) - { - b.UpdateSource(); + BindingExpression b = GetBindingExpression(ValueProperty); + if (b != null) + { + b.UpdateSource(); + } } } |
