C# Class Caliburn.Micro.WindowManager

A service that manages windows.
Inheritance: IWindowManager
Show file Open project: dbuksbaum/Learning-Caliburn.Micro Class Usage Examples

Public Methods

Method Description
GetSignificantView ( DependencyObject view ) : DependencyObject

Used to retrieve the root, non-framework-created view.

In certain instances the WindowManager creates UI elements in order to display windows. For example, if you ask the window manager to show a UserControl as a dialog, it creates a window to host the UserControl in. The WindowManager marks that element as a framework-created element so that it can determine what it created vs. what was intended by the developer. Calling GetSignificantView allows the framework to discover what the original element was.

Show ( object rootModel, object context = null ) : void

Shows a window for the specified model.

ShowDialog ( object rootModel, object context = null ) : bool?

Shows a modal dialog for the specified model.

ShowDialog ( object rootModel, object context = null ) : void

Shows a modal dialog for the specified model.

Private Methods

Method Description
CreateWindow ( object rootModel, bool isDialog, object context ) : Window
EnsureWindow ( object model, object view ) : System.Windows.Controls.ChildWindow
EnsureWindow ( object model, object view, bool isDialog ) : Window
OnShutdownAttempted ( IGuardClose guard, System.Windows.Controls.ChildWindow view, CancelEventArgs e ) : void
OnShutdownAttempted ( IGuardClose guard, Window view, CancelEventArgs e ) : void

Method Details

GetSignificantView() public static method

Used to retrieve the root, non-framework-created view.
In certain instances the WindowManager creates UI elements in order to display windows. For example, if you ask the window manager to show a UserControl as a dialog, it creates a window to host the UserControl in. The WindowManager marks that element as a framework-created element so that it can determine what it created vs. what was intended by the developer. Calling GetSignificantView allows the framework to discover what the original element was.
public static GetSignificantView ( DependencyObject view ) : DependencyObject
view System.Windows.DependencyObject The view to search.
return System.Windows.DependencyObject

Show() public method

Shows a window for the specified model.
public Show ( object rootModel, object context = null ) : void
rootModel object The root model.
context object The context.
return void

ShowDialog() public method

Shows a modal dialog for the specified model.
public ShowDialog ( object rootModel, object context = null ) : bool?
rootModel object The root model.
context object The context.
return bool?

ShowDialog() public method

Shows a modal dialog for the specified model.
public ShowDialog ( object rootModel, object context = null ) : void
rootModel object The root model.
context object The context.
return void