public bool MoveToPrevTab() { bool res = false; int idx = docs.IndexOf(this.DockPanel.ActiveDocument); if (idx != -1) { ToolWindow winNext = (ToolWindow)docs[idx == docs.Count - 1 ? 0 : idx + 1]; winNext.Activate(); res = true; } return(res); }
public bool MoveToPrevTab() { bool res = false; IList <IDockContent> docs = GetDocuments(); int idx = docs.IndexOf(this.DockPanel.ActiveDocument); if (idx != -1) { ToolWindow winPrev = (ToolWindow)docs[idx == 0 ? docs.Count - 1 : idx - 1]; winPrev.Activate(); res = true; } return(res); }
///////////////////////////////////////////////////////////////////////////////////////////////////// // NON-PUBLIC PROCEDURES ///////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Creates and floats a tool window. /// </summary> private void CreateAndFloatToolWindow() { var textBox = new TextBox() { BorderThickness = new Thickness(), Text = "This floating window will fade out when it loses focus.", TextWrapping = TextWrapping.Wrap }; var toolWindow = new ToolWindow(dockSite, "tool", "Floating Tool Window", null, textBox); toolWindow.Float(new Point(400, 200)); toolWindow.Activate(); }
private void switchToTab(ToolWindow window) { IsSwitchingTabs = true; window.Activate(); IsSwitchingTabs = false; }
/// <summary> /// Добавляет окно инструментов /// </summary> /// <param name="window"></param> void AddToolWindow(ToolWindow window) { mTools.Add(window); window.Show(mDockingManager, AnchorStyle.Left); window.Activate(); }
/// <summary> /// Opens the tool windows for this sample. /// </summary> private void OpenToolWindows() { var toolWindow = new ToolWindow(dockSite, "right1", "Tool Window 1", null, new TextBox() { BorderThickness = new Thickness(0), TextWrapping = TextWrapping.Wrap, Text = "This first tool window has no default dock side set, and will fall back to docking on the right side of the primary dock host." }); toolWindow.WindowGroupName = "Right Group"; toolWindow.ContainerDockedSize = new Size(150, 200); toolWindow.Activate(false); toolWindow = new ToolWindow(dockSite, "bottom1", "Tool Window 2", null, new TextBox() { BorderThickness = new Thickness(0), TextWrapping = TextWrapping.Wrap, Text = "This second tool window has DefaultDockSide == Bottom and will default to open at the bottom of the primary dock host." }); toolWindow.DefaultDockSide = Side.Bottom; toolWindow.WindowGroupName = "Bottom Group"; toolWindow.ContainerDockedSize = new Size(200, 150); toolWindow.Activate(false); toolWindow = new ToolWindow(dockSite, "bottom2", "Tool Window 3", null, new TextBox() { BorderThickness = new Thickness(0), TextWrapping = TextWrapping.Wrap, Text = "This third tool window has no default dock side set, but is in the same WindowGroupName as 'Tool Window 2', and will default to attach to it." }); toolWindow.WindowGroupName = "Bottom Group"; toolWindow.ContainerDockedSize = new Size(200, 150); toolWindow.Activate(false); toolWindow = new ToolWindow(dockSite, "right2", "Tool Window 4", null, new TextBox() { BorderThickness = new Thickness(0), TextWrapping = TextWrapping.Wrap, Text = "This fourth tool window has DefaultDockSide == Bottom, but is in the same WindowGroupName as 'Tool Window 1', and will default to attach to it because that takes priority over DefaultDockSide." }); toolWindow.DefaultDockSide = Side.Bottom; toolWindow.WindowGroupName = "Right Group"; toolWindow.ContainerDockedSize = new Size(150, 200); toolWindow.Activate(false); toolWindow = new ToolWindow(dockSite, "left1", "Tool Window 5", null, new TextBox() { BorderThickness = new Thickness(0), TextWrapping = TextWrapping.Wrap, Text = "This fifth tool window specifies the same parameters as 'Tool Window 4' but also has a DefaultLocationRequested event handler that overrides everything by forcing a left side dock." }); toolWindow.DefaultDockSide = Side.Bottom; toolWindow.WindowGroupName = "Right Group"; toolWindow.ContainerDockedSize = new Size(150, 200); toolWindow.DefaultLocationRequested += (sender, e) => { if (e.State == DockingWindowState.Docked) { // Force a left side dock e.Target = null; e.Side = Side.Left; } }; toolWindow.Activate(false); toolWindow = new ToolWindow(dockSite, "bottomLeft1", "Tool Window 6", null, new TextBox() { BorderThickness = new Thickness(0), TextWrapping = TextWrapping.Wrap, Text = "This sixth tool window's default location is set in a generalized DockSite.WindowDefaultLocationRequested event handler." }); toolWindow.ContainerDockedSize = new Size(150, 200); toolWindow.Activate(false); }