/// <summary> /// Initializes a new instance of the <see cref="FloatingDockWindow"/> class. /// </summary> /// <param name="host">The host.</param> public FloatingDockWindow(DockHost host) { DataContext = host.DataContext; Title = host.Title; Closing += (o, e) => { host.WindowClosing = true; if (!AutoDockOnClose) { host.ContentVisibility = Visibility.Collapsed; // Also causes the content to dock again... although it won't be visible at this point... but if the control becomes visible again, the content will be there again } else { host.IsDocked = true; } host.WindowClosing = false; host.FloatWindow = null; }; }
/// <summary> /// Initializes a new instance of the <see cref="FloatingDockWindow"/> class. /// </summary> /// <param name="host">The host.</param> public FloatingDockWindow(DockHost host) { DataContext = host.DataContext; Title = host.Title; Closing += (o, e) => { host.WindowClosing = true; if (!AutoDockOnClose) host.ContentVisibility = Visibility.Collapsed; // Also causes the content to dock again... although it won't be visible at this point... but if the control becomes visible again, the content will be there again else host.IsDocked = true; host.WindowClosing = false; host.FloatWindow = null; }; }