private void OpenWindow(WindowPositionSide side, WpfScreen screen) { if (side == WindowPositionSide.None) { return; } CloseWindowIfExists(); double dockwindowLeft, dockwindowWidth; switch (side) { case WindowPositionSide.Left: dockwindowLeft = WpfScreen.MostLeftX; dockwindowWidth = 300; break; case WindowPositionSide.Right: dockwindowLeft = WpfScreen.MostRightX - 300; dockwindowWidth = 300; break; case WindowPositionSide.Top: return; default: throw new ArgumentOutOfRangeException("side"); } _window = new DockRangeWindow(screen.WorkingArea.Top, dockwindowLeft, screen.WorkingArea.Height, dockwindowWidth); _window.Show(); }
private void CloseWindowIfExists() { if (_window != null) { _window.Close(); _window = null; } }