XElement CreateFloatingContentElement(FloatingWindow floatingWindow) { return(new XElement("FloatingContent", new XAttribute("Left", floatingWindow.NormalRect.Left), new XAttribute("Top", floatingWindow.NormalRect.Top), new XAttribute("Width", floatingWindow.NormalRect.Width), new XAttribute("Height", floatingWindow.NormalRect.Height), new XAttribute("IsMaximized", (floatingWindow.WindowState == WindowState.Maximized)), CreateTabNodeElement(floatingWindow.SplitTabsControl.rootTabNode))); }
FloatingWindow CreateFloatingHost(bool activateRoot) { // Only the "master" control creates floating hosts, and manages the list if (this.masterControl != null) { return(this.masterControl.CreateFloatingHost(activateRoot)); } var window = new FloatingWindow(new SplitTabsControl { masterControl = this }); window.Loaded += (s, e) => { // Some things must be delayed until the window is shown. Note that we "steal" // command bindings from our parent window (which is the app's main window) so // key bindings continue to work. window.Owner = this.FindParent <Window>(); window.CommandBindings.AddRange(window.Owner.CommandBindings); // The activateRoot flag is set to false if we're creating this floating window as // part of window state loading, in which case the correct tab will be made active // as specified in the stored state. if (activateRoot) { window.SplitTabsControl.ActivateTabNode(window.SplitTabsControl.rootTabNode); } }; window.Closed += (s, e) => { this.floatingWindows.Remove(window); }; window.Activated += (s, e) => { window.ActivationIndex = ++nextActivationIndex; }; if (this.floatingWindows == null) { this.floatingWindows = new List <FloatingWindow>(); } this.floatingWindows.Add(window); return(window); }
FloatingWindow CreateFloatingHost(bool activateRoot) { // Only the "master" control creates floating hosts, and manages the list if (this.masterControl != null) { return this.masterControl.CreateFloatingHost(activateRoot); } var window = new FloatingWindow(new SplitTabsControl { masterControl = this }); window.Loaded += (s, e) => { // Some things must be delayed until the window is shown. Note that we "steal" // command bindings from our parent window (which is the app's main window) so // key bindings continue to work. window.Owner = this.FindParent<Window>(); window.CommandBindings.AddRange(window.Owner.CommandBindings); // The activateRoot flag is set to false if we're creating this floating window as // part of window state loading, in which case the correct tab will be made active // as specified in the stored state. if (activateRoot) { window.SplitTabsControl.ActivateTabNode(window.SplitTabsControl.rootTabNode); } }; window.Closed += (s, e) => { this.floatingWindows.Remove(window); }; window.Activated += (s, e) => { window.ActivationIndex = ++nextActivationIndex; }; if (this.floatingWindows == null) { this.floatingWindows = new List<FloatingWindow>(); } this.floatingWindows.Add(window); return window; }
XElement CreateFloatingContentElement(FloatingWindow floatingWindow) { return new XElement("FloatingContent", new XAttribute("Left", floatingWindow.NormalRect.Left), new XAttribute("Top", floatingWindow.NormalRect.Top), new XAttribute("Width", floatingWindow.NormalRect.Width), new XAttribute("Height", floatingWindow.NormalRect.Height), new XAttribute("IsMaximized", (floatingWindow.WindowState == WindowState.Maximized)), CreateTabNodeElement(floatingWindow.SplitTabsControl.rootTabNode)); }