/// <summary> /// Removes the overlay under the modal window. /// </summary> internal void RemoveOverlay() { if (overlay.IsVisible()) { FloatingWindow topmostWindow = null; if (FloatingWindows.Count(x => x.IsOpen && x.IsModal) == 0) { // If there are no more modal windows - remove the overlay VisualStateManager.GoToState(this, VSMSTATE_HiddenOverlay, true); topmostWindow = GetTopmostWindow(); } else { topmostWindow = GetTopmostModalWindow(); if (topmostWindow != null) { topmostWindow.MoveToContainer(modalCanvas); } } SetFocusToActiveWindow(topmostWindow); } }
/// <summary> /// Moves the window to the "modal" layer. /// </summary> /// <param name="modalWindow">The modal window.</param> private void MoveWindowToModalLayer(FloatingWindow modalWindow) { FloatingWindow window = this.ModalWindow; if (window != null && window != modalWindow) { // If there is already a modal window - move it to the HostCanvas window.MoveToContainer(hostCanvas); SetTopmost(window); } modalWindow.MoveToContainer(modalCanvas); }