protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { bool CanHide = HideWindowCommand.CanExecute(null); if (CloseInitiatedByUser && !KeepContentVisibleOnClose && !CanHide) { e.Cancel = true; if (CanHide == true) { _model.Descendents().OfType <LayoutAnchorable>().ToArray().ForEach <LayoutAnchorable>((a) => a.Hide()); } } base.OnClosing(e); }
private void RefreshButtons() { ShowWindowCommand.RaiseCanExecuteChanged(); HideWindowCommand.RaiseCanExecuteChanged(); CloseWindowCommand.RaiseCanExecuteChanged(); }