private static void Dock(WindowOperationEventArgs e) { if (e.Window.WindowState == WindowState.Maximized) { e.Window.WindowState = WindowState.Normal; } }
private static void Maximise(WindowOperationEventArgs e) { if (e.Window.WindowState == WindowState.Normal) { e.Window.WindowState = WindowState.Maximized; } }
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(); }
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; } } }
private void Minimise(WindowOperationEventArgs e) { minimisedWindowState = e.Window.WindowState; e.Window.WindowState = WindowState.Minimized; lastMinimised = e.Window; }
private void SnapRight(WindowOperationEventArgs e) { PerformSnap(e.Window, true); }
private void SnapLeft(WindowOperationEventArgs e) { PerformSnap(e.Window, false); }
private void Close(WindowOperationEventArgs e) { e.Window.Close(); RemoveInfo(e.Window); }