Esempio n. 1
0
 private static void Dock(WindowOperationEventArgs e)
 {
     if (e.Window.WindowState == WindowState.Maximized)
     {
         e.Window.WindowState = WindowState.Normal;
     }
 }
Esempio n. 2
0
 private static void Maximise(WindowOperationEventArgs e)
 {
     if (e.Window.WindowState == WindowState.Normal)
     {
         e.Window.WindowState = WindowState.Maximized;
     }
 }
Esempio n. 3
0
        private void Tab(WindowOperationEventArgs e)
        {
            int    currentLoc    = Windows.IndexOf(e.Window);
            Window ToMoveToFront = Windows[currentLoc + 1 >= Windows.Count ? 0 : currentLoc + 1];

            ToMoveToFront.Activate();
            ToMoveToFront.Focus();
        }
Esempio n. 4
0
        private void WindowOperationOccurred(object sender, WindowOperationEventArgs e)
        {
            if (!(e.Window is MainWindow) || e.Gesture == GestureType.LARGE_SWIPE_UP) // Don't want any operations that might close the background window
            {
                switch (e.Gesture)
                {
                case GestureType.LARGE_SWIPE_DOWN:
                    Minimise(e);
                    break;

                case GestureType.LARGE_SWIPE_UP:
                    Restore();
                    break;

                case GestureType.LARGE_SWIPE_RIGHT:
                    SnapRight(e);
                    break;

                case GestureType.LARGE_SWIPE_LEFT:
                    SnapLeft(e);
                    break;

                case GestureType.EXPLOSION_IN:
                    Dock(e);
                    break;

                case GestureType.EXPLOSION_OUT:
                    Maximise(e);
                    break;

                case GestureType.LEFT_SWIPE_RIGHT_RIGHT_HAND_RAISED:
                    Tab(e);
                    break;

                case GestureType.CROSS_ARMS:
                    Close(e);
                    break;
                }
            }
        }
Esempio n. 5
0
 private void Minimise(WindowOperationEventArgs e)
 {
     minimisedWindowState = e.Window.WindowState;
     e.Window.WindowState = WindowState.Minimized;
     lastMinimised        = e.Window;
 }
Esempio n. 6
0
 private void SnapRight(WindowOperationEventArgs e)
 {
     PerformSnap(e.Window, true);
 }
Esempio n. 7
0
 private void SnapLeft(WindowOperationEventArgs e)
 {
     PerformSnap(e.Window, false);
 }
Esempio n. 8
0
 private void Close(WindowOperationEventArgs e)
 {
     e.Window.Close();
     RemoveInfo(e.Window);
 }