public virtual DialogScreenResult Show( Window window, IScreenFactory <IScreenBase> screen, bool modal ) { return(WindowLifecycle.Show( _aggregator, _windowService, window, screen, modal )); }
/// <remarks> /// Note to inheritors: This method does not call <see /// cref="Show(Window,IScreenFactory{IScreenBase},bool)"/>. /// </remarks> public virtual void Show( IScreenFactory <IScreenBase> screen, IScreenBase parent = null, string title = null ) { Window ownerWin = GetAssociatedWindow(parent); Window window = _windowService.CreateWindow(ownerWin, title, false); WindowLifecycle.Show( _aggregator, _windowService, window, screen, modal: false ); }
/// <remarks> /// Note to inheritors: This method does not call <see /// cref="Show(Window, IScreenFactory{IScreenBase}, bool)"/>. /// </remarks> public virtual DialogScreenResult ShowDialog( IScreenFactory <IScreenBase> screen, IScreenBase parent = null, string title = null ) { Window ownerWin = GetAssociatedWindow(parent); Window window = _windowService.CreateWindow(ownerWin, title, true); return(WindowLifecycle.Show( _aggregator, _windowService, window, screen, modal: true )); }
public Window GetAssociatedWindow(IScreenBase screen) { if (screen == null) { return(null); } WindowLifecycle lf = ScreenTreeHelper .GetAncestorsOf(screen, includeSelf: true) .SelectMany(s => s.Children.OfType <WindowLifecycle>()) .FirstOrDefault(); if (lf != null) { return(lf.Window); } throw new ArgumentException(ExceptionTexts.NoAssociatedWindow); }
public static DialogScreenResult Show( EventAggregator aggregator, IWindowService windowService, Window window, IScreenFactory <IScreenBase> screenFactory, bool modal ) { var lf = new WindowLifecycle(aggregator, windowService, window); if (modal) { return(lf.ShowModal(screenFactory)); } else { lf.Show(screenFactory); return(null); } }