diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs | 56 |
1 files changed, 12 insertions, 44 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs index 3f9106089..786a1799a 100644 --- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs +++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs @@ -26,8 +26,6 @@ namespace Tango.Touch.Keyboard [ContentProperty(nameof(View))] public partial class KeyboardView : Control { - public event EventHandler KeyboardOpened; - public event EventHandler KeyboardClosed; private static KeyboardView _instance; private List<Object> _has_focus_objects = new List<object>(); @@ -45,19 +43,6 @@ namespace Tango.Touch.Keyboard #region Properties - public static KeyboardView Default - { - get { return _instance; } - } - - public static TouchKeyboard Keyboard - { - get - { - return Default.keyboard; - } - } - public bool IsOpened { get { return (bool)GetValue(IsOpenedProperty); } @@ -74,14 +59,6 @@ namespace Tango.Touch.Keyboard public static readonly DependencyProperty ViewProperty = DependencyProperty.Register("View", typeof(FrameworkElement), typeof(KeyboardView), new PropertyMetadata(null)); - public KeyboardOutputMode OutputMode - { - get { return (KeyboardOutputMode)GetValue(OutputModeProperty); } - set { SetValue(OutputModeProperty, value); } - } - public static readonly DependencyProperty OutputModeProperty = - DependencyProperty.Register("OutputMode", typeof(KeyboardOutputMode), typeof(KeyboardView), new PropertyMetadata(KeyboardOutputMode.Wpf)); - #endregion #region Attached Properties @@ -135,30 +112,21 @@ namespace Tango.Touch.Keyboard { if (!IsOpened) { - if (OutputMode == KeyboardOutputMode.Wpf) + if (GetContainer(_lastFocusedElement) != null) { - if (GetContainer(_lastFocusedElement) != null) - { - var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList(); + var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList(); - scrollViewers.ForEach(x => x.DisableScrolling = true); + scrollViewers.ForEach(x => x.DisableScrolling = true); - ThicknessAnimation ani = new ThicknessAnimation(); - ani.Completed += (_, __) => - { - scrollViewers.ForEach(x => x.DisableScrolling = false); - }; - ani.To = new Thickness(0); - ani.Duration = TimeSpan.FromSeconds(0.2); - GetContainer(_lastFocusedElement).BeginAnimation(FrameworkElement.MarginProperty, ani); - } + ThicknessAnimation ani = new ThicknessAnimation(); + ani.Completed += (_, __) => + { + scrollViewers.ForEach(x => x.DisableScrolling = false); + }; + ani.To = new Thickness(0); + ani.Duration = TimeSpan.FromSeconds(0.2); + GetContainer(_lastFocusedElement).BeginAnimation(FrameworkElement.MarginProperty, ani); } - - KeyboardClosed?.Invoke(this, new EventArgs()); - } - else - { - KeyboardOpened?.Invoke(this, new EventArgs()); } } @@ -350,7 +318,7 @@ namespace Tango.Touch.Keyboard private void OnMouseDown(object sender, MouseOrTouchEventArgs e) { - if (e.OriginalSource.GetType().Name != "TextBoxView" && e.Source == _content_presenter && IsOpened && OutputMode == KeyboardOutputMode.Wpf) + if (e.OriginalSource.GetType().Name != "TextBoxView" && e.Source == _content_presenter && IsOpened) { IsOpened = false; } |
