private void ViewModel_PreviewHide(object sender, EventArgs e) { foreach (Window wind in DockSite.GetAllFloatWindows(this)) { wind.Close(); } }
private void ViewModel_PreviewShow(object sender, EventArgs e) { foreach (Window wind in DockSite.GetAllFloatWindows(this)) { if (wind.WindowState == WindowState.Minimized) { wind.WindowState = WindowState.Normal; } wind.Show(); wind.Activate(); wind.Focus(); // needs focus so the Esc key will close (hide) the preview } }