Example #1
0
        public void ShowKeyboard(bool Show, ValidatingTextBox Control)
        {
            if (!m_IsKeyboardShown && Show)
            {
                m_IsKeyboardShown = true;

                var asPopup =
                    !(Control.TransformToAncestor(this).Transform(new Point(0, Control.ActualHeight)).Y >
                      Height - defaultKeyboard.Height);

                if (asPopup)
                {
                    defaultKeyboard.Show(Settings.Default.IsAnimationEnabled);
                    keyboardPopup.IsOpen = true;
                }
                else
                {
                    keyboardBorder.Height = defaultKeyboard.Height;
                    defaultKeyboard.Show(Settings.Default.IsAnimationEnabled);
                    keyboardPopup.IsOpen = true;
                    AnimateScrollViewer(defaultKeyboard.Height);
                }
            }

            if (m_IsKeyboardShown && !Show)
            {
                m_IsKeyboardShown = false;
                AnimateScrollViewer(0);
                defaultKeyboard.Hide(Settings.Default.IsAnimationEnabled);
            }
        }