internal void Close(Form form, Form previousForm) { _currentForm = previousForm; if (_currentForm == null) { _mainView.IsEnabled = true; _mainView.Focus(); } }
internal void Show(Form form) { if (_mainView == null) { return; } if (_currentForm == null) { _mainView.IsEnabled = false; } Grid overlayElement = null; Brush overlayBrush = FormBackground; if (overlayBrush != null) { overlayElement = new Grid(); overlayElement.Background = overlayBrush; } form.Show(_rootElement, _currentForm, overlayElement); }
internal void Show(Panel parentPanel, Form parentForm, FrameworkElement overlayElement) { _parentForm = parentForm; _overlayElement = overlayElement; if (parentForm != null) { parentForm.IsEnabled = false; } if (_overlayElement != null) { parentPanel.Children.Add(_overlayElement); } parentPanel.Children.Add(this); Visibility = Visibility.Visible; Effect showEffect = ShowEffect; if (showEffect == null) { _canClose = true; Focus(); } else { _canClose = false; if (((IAttachedObject)showEffect).AssociatedObject != this) { ((IAttachedObject)showEffect).Attach(this); showEffect.Completed += OnShowEffectCompleted; } showEffect.PlayEffect(EffectDirection.Forward); } }