C# Class Catel.MVVM.Providers.WindowLogic

MVVM Provider behavior implementation for a window.
Inheritance: LogicBase
Show file Open project: Catel/Catel Class Usage Examples

Private Properties

Property Type Description
InvokeCloseDynamically void

Public Methods

Method Description
OnTargetViewUnloadedAsync ( object sender, EventArgs e ) : System.Threading.Tasks.Task

Called when LogicBase.TargetView has just been unloaded.

OnTargetWindowClosed ( ) : void

Called when the TargetWindow has been closed.

Public to allow the generated ILGenerator to access this method.

OnViewModelClosedAsync ( object sender, ViewModelClosedEventArgs e ) : System.Threading.Tasks.Task

Called when the LogicBase.ViewModel is closed.

WindowLogic ( IView targetWindow, Type viewModelType = null, IViewModel viewModel = null ) : System

Initializes a new instance of the WindowLogic class.

Protected Methods

Method Description
SetDataContext ( object newDataContext ) : void

Sets the data context of the target control. This method is abstract because the real logic implementation knows how to set the data context (for example, by using an additional data context grid).

Private Methods

Method Description
InvokeCloseDynamically ( ) : void

Invokes the close method on the window dynamically.

Method Details

OnTargetViewUnloadedAsync() public method

Called when LogicBase.TargetView has just been unloaded.
public OnTargetViewUnloadedAsync ( object sender, EventArgs e ) : System.Threading.Tasks.Task
sender object The sender.
e System.EventArgs The instance containing the event data.
return System.Threading.Tasks.Task

OnTargetWindowClosed() public method

Called when the TargetWindow has been closed.
Public to allow the generated ILGenerator to access this method.
public OnTargetWindowClosed ( ) : void
return void

OnViewModelClosedAsync() public method

Called when the LogicBase.ViewModel is closed.
public OnViewModelClosedAsync ( object sender, ViewModelClosedEventArgs e ) : System.Threading.Tasks.Task
sender object The sender.
e ViewModelClosedEventArgs The instance containing the event data.
return System.Threading.Tasks.Task

SetDataContext() protected method

Sets the data context of the target control. This method is abstract because the real logic implementation knows how to set the data context (for example, by using an additional data context grid).
protected SetDataContext ( object newDataContext ) : void
newDataContext object The new data context.
return void

WindowLogic() public method

Initializes a new instance of the WindowLogic class.
The is null.
public WindowLogic ( IView targetWindow, Type viewModelType = null, IViewModel viewModel = null ) : System
targetWindow IView The window this provider should take care of.
viewModelType System.Type Type of the view model.
viewModel IViewModel The view model to inject.
return System