aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-07-02 19:03:59 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-07-02 19:03:59 +0300
commit2d340ef8bbbb5a1c7f3415da704a0b83c28c07b4 (patch)
treee051087540ca37ab98c253075adf90b16fe6c665 /Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs
parent327fe90a471c74a5723258ccbda7d9ade064b50c (diff)
downloadTango-2d340ef8bbbb5a1c7f3415da704a0b83c28c07b4.tar.gz
Tango-2d340ef8bbbb5a1c7f3415da704a0b83c28c07b4.zip
WOrking on PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs
index b70750286..d5ecdfdeb 100644
--- a/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchTextBox.cs
@@ -12,6 +12,7 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using Tango.Core.EventArguments;
using Tango.Touch.Keyboard;
namespace Tango.Touch.Controls
@@ -44,6 +45,31 @@ namespace Tango.Touch.Controls
public static readonly DependencyProperty IsPasswordProperty =
DependencyProperty.Register("IsPassword", typeof(bool), typeof(TouchTextBox), new PropertyMetadata(false));
+ public bool IsReadOnly
+ {
+ get { return (bool)GetValue(IsReadOnlyProperty); }
+ set { SetValue(IsReadOnlyProperty, value); }
+ }
+ public static readonly DependencyProperty IsReadOnlyProperty =
+ DependencyProperty.Register("IsReadOnly", typeof(bool), typeof(TouchTextBox), new PropertyMetadata(false));
+
+ public ICommand TapCommand
+ {
+ get { return (ICommand)GetValue(TapCommandProperty); }
+ set { SetValue(TapCommandProperty, value); }
+ }
+ public static readonly DependencyProperty TapCommandProperty =
+ DependencyProperty.Register("TapCommand", typeof(ICommand), typeof(TouchTextBox), new PropertyMetadata(null));
+
+ public Object TapCommandParameter
+ {
+ get { return (Object)GetValue(TapCommandParameterProperty); }
+ set { SetValue(TapCommandParameterProperty, value); }
+ }
+ public static readonly DependencyProperty TapCommandParameterProperty =
+ DependencyProperty.Register("TapCommandParameter", typeof(Object), typeof(TouchTextBox), new PropertyMetadata(null));
+
+
static TouchTextBox()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchTextBox), new FrameworkPropertyMetadata(typeof(TouchTextBox)));
@@ -56,6 +82,16 @@ namespace Tango.Touch.Controls
_text_box = GetTemplateChild("PART_TextBox") as TextBox;
_text_box.GotFocus += _text_box_GotFocus;
+
+ this.RegisterForPreviewMouseOrTouchUp(OnMouseOrTouchUp);
+ }
+
+ private void OnMouseOrTouchUp(object sender, MouseOrTouchEventArgs e)
+ {
+ if (TapCommand != null)
+ {
+ TapCommand.Execute(TapCommandParameter);
+ }
}
private async void _text_box_GotFocus(object sender, RoutedEventArgs e)