private void KeyboardOpened(Rectangle keyboardPosition)
        {
            Debug.WriteLine("KeyboardOpened");

            if (WindowManipulationHelper.IsForegroundWindowMaximized() &&
                IsKeyboardInDockedMode() &&
                !WindowManipulationHelper.IsForegroundWindowUWP())
            {
                isVisible = true;

                if (TabletModeHelper.IsTabletMode)
                {
                    ShowDock(keyboardPosition);
                    lastWindowState = null;
                }
                else
                {
                    ShrinkForegroundWindow(keyboardPosition);
                }
            }
            else
            {
                lastWindowState = null;
            }
        }
        private void ShrinkForegroundWindow(Rectangle keyboardPosition)
        {
            var taskbarSize     = TaskbarHelper.GetTaskbarSize();
            var taskbarPosition = TaskbarHelper.GetTaskbarPosition();
            var diff            = 0;

            if (taskbarPosition == TaskbarHelper.TaskbarPosition.Bottom)
            {
                diff = -taskbarSize.Height;
            }

            lastWindowState = WindowManipulationHelper.ChangeForegroundWindowToWindowedFullScreen(
                keyboardPosition.Height + diff);
        }