Daniel's XL Toolbox NG
Bovender.Mvvm.Actions.MessageActionBase Class Referenceabstract

Abstract base class for MVVM messaging actions. Derived classes must implement a CreateView method that returns a view for the view model that is expected to be received as a message content. More...

Inheritance diagram for Bovender.Mvvm.Actions.MessageActionBase:
Collaboration diagram for Bovender.Mvvm.Actions.MessageActionBase:

Protected Member Functions

override void Invoke (object parameter)
 Creates a view that has its dependent view model injected into it. More...
 
void Invoke< T > (T messageContent, Action respond)
 
virtual void ShowView (Window view)
 Shows the view as a modal dialog. Override this to do something else with the view. More...
 
abstract Window CreateView ()
 Returns a view that can bind to expected message contents. More...
 
override void Invoke (object parameter)
 Creates a view that has its dependent view model injected into it. More...
 
void Invoke< T > (T messageContent, Action respond)
 
virtual void ShowView (Window view)
 Shows the view as a modal dialog. Override this to do something else with the view. More...
 
abstract Window CreateView ()
 Returns a view that can bind to expected message contents. More...
 

Properties

string Caption [get, set]
 
string Message [get, set]
 
MessageContent Content [get, protected set]
 

Detailed Description

Abstract base class for MVVM messaging actions. Derived classes must implement a CreateView method that returns a view for the view model that is expected to be received as a message content.

Member Function Documentation

◆ CreateView() [1/2]

◆ CreateView() [2/2]

◆ Invoke() [1/2]

override void Bovender.Mvvm.Actions.MessageActionBase.Invoke ( object  parameter)
inlineprotected

Creates a view that has its dependent view model injected into it.

This methods delegates the creation of the view instance to the virtual CreateView method. If this method injects a view model into the view's DataContext, the view will simply be shown (as a dialog). If the CreateView method does not inject the dependeny, the Invoke method will inject 'this' (i.e., the MessageActionBase object or a descendant) into the view and sets the RequestClose event handler.

Parameters
parameterMessageArgs argument for the Message.Sent event.

◆ Invoke() [2/2]

override void Bovender.Mvvm.Actions.MessageActionBase.Invoke ( object  parameter)
inlineprotected

Creates a view that has its dependent view model injected into it.

This methods delegates the creation of the view instance to the virtual CreateView method. If this method injects a view model into the view's DataContext, the view will simply be shown (as a dialog). If the CreateView method does not inject the dependeny, the Invoke method will inject 'this' (i.e., the MessageActionBase object or a descendant) into the view and sets the RequestClose event handler.

Parameters
parameterMessageArgs argument for the Message.Sent event.

◆ Invoke< T >() [1/2]

void Bovender.Mvvm.Actions.MessageActionBase.Invoke< T > ( messageContent,
Action  respond 
)
inlineprotected
Type Constraints
T :MessageContent 

◆ Invoke< T >() [2/2]

void Bovender.Mvvm.Actions.MessageActionBase.Invoke< T > ( messageContent,
Action  respond 
)
inlineprotected
Type Constraints
T :MessageContent 

◆ ShowView() [1/2]

virtual void Bovender.Mvvm.Actions.MessageActionBase.ShowView ( Window  view)
inlineprotectedvirtual

Shows the view as a modal dialog. Override this to do something else with the view.

Parameters
viewWindow object previously created by CreateView.

This method is called internally by the Invoke method.

Reimplemented in Bovender.Mvvm.Actions.ShowViewAction, Bovender.Mvvm.Actions.ShowViewAction, Bovender.Mvvm.Actions.ShowViewDialogAction, and Bovender.Mvvm.Actions.ShowViewDialogAction.

◆ ShowView() [2/2]

virtual void Bovender.Mvvm.Actions.MessageActionBase.ShowView ( Window  view)
inlineprotectedvirtual

Shows the view as a modal dialog. Override this to do something else with the view.

Parameters
viewWindow object previously created by CreateView.

This method is called internally by the Invoke method.

Reimplemented in Bovender.Mvvm.Actions.ShowViewAction, Bovender.Mvvm.Actions.ShowViewAction, Bovender.Mvvm.Actions.ShowViewDialogAction, and Bovender.Mvvm.Actions.ShowViewDialogAction.

Property Documentation

◆ Caption

string Bovender.Mvvm.Actions.MessageActionBase.Caption
getset

◆ Content

MessageContent Bovender.Mvvm.Actions.MessageActionBase.Content
getprotected set

◆ Message

string Bovender.Mvvm.Actions.MessageActionBase.Message
getset

The documentation for this class was generated from the following file: