GalaSoft.MvvmLight
A command whose sole purpose is to relay its functionality to other
objects by invoking delegates. The default return value for the CanExecute
method is 'true'. This class does not allow you to accept command parameters in the
Execute and CanExecute callback methods.
If you are using this class in WPF4.5 or above, you need to use the
GalaSoft.MvvmLight.CommandWpf namespace (instead of GalaSoft.MvvmLight.Command).
This will enable (or restore) the CommandManager class which handles
automatic enabling/disabling of controls based on the CanExecute delegate.
Initializes a new instance of the RelayCommand class that
can always execute.
The execution logic. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is causing a closure. See
http://galasoft.ch/s/mvvmweakaction.
If the execute argument is null.
Initializes a new instance of the RelayCommand class.
The execution logic. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
The execution status logic. IMPORTANT: If the func causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is causing a closures. See
http://galasoft.ch/s/mvvmweakaction.
If the execute argument is null.
Occurs when changes occur that affect whether the command should execute.
Raises the event.
Defines the method that determines whether the command can execute in its current state.
This parameter will always be ignored.
true if this command can be executed; otherwise, false.
Defines the method to be called when the command is invoked.
This parameter will always be ignored.
A generic command whose sole purpose is to relay its functionality to other
objects by invoking delegates. The default return value for the CanExecute
method is 'true'. This class allows you to accept command parameters in the
Execute and CanExecute callback methods.
The type of the command parameter.
If you are using this class in WPF4.5 or above, you need to use the
GalaSoft.MvvmLight.CommandWpf namespace (instead of GalaSoft.MvvmLight.Command).
This will enable (or restore) the CommandManager class which handles
automatic enabling/disabling of controls based on the CanExecute delegate.
Initializes a new instance of the RelayCommand class that
can always execute.
The execution logic. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is causing a closure. See
http://galasoft.ch/s/mvvmweakaction.
If the execute argument is null.
Initializes a new instance of the RelayCommand class.
The execution logic. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
The execution status logic. IMPORTANT: If the func causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is causing a closure. See
http://galasoft.ch/s/mvvmweakaction.
If the execute argument is null.
Occurs when changes occur that affect whether the command should execute.
Raises the event.
Defines the method that determines whether the command can execute in its current state.
Data used by the command. If the command does not require data
to be passed, this object can be set to a null reference
true if this command can be executed; otherwise, false.
Defines the method to be called when the command is invoked.
Data used by the command. If the command does not require data
to be passed, this object can be set to a null reference
Helper class for platform detection.
This interface is meant for the class and can be
useful if you store multiple WeakAction{T} instances but don't know in advance
what type T represents.
The target of the WeakAction.
Executes an action.
A parameter passed as an object,
to be casted to the appropriate type.
Deletes all references, which notifies the cleanup method
that this entry must be deleted.
This interface is meant for the class and can be
useful if you store multiple WeakFunc{T} instances but don't know in advance
what type T represents.
Executes a Func and returns the result.
A parameter passed as an object,
to be casted to the appropriate type.
The result of the operation.
Stores an without causing a hard reference
to be created to the Action's owner. The owner can be garbage collected at any time.
Gets or sets the corresponding to this WeakAction's
method passed in the constructor.
Gets the name of the method that this WeakAction represents.
Gets or sets a WeakReference to this WeakAction's action's target.
This is not necessarily the same as
, for example if the
method is anonymous.
Saves the as a hard reference. This is
used in relation with this instance's constructor and only if
the constructor's keepTargetAlive parameter is true.
Gets or sets a WeakReference to the target passed when constructing
the WeakAction. This is not necessarily the same as
, for example if the
method is anonymous.
Gets a value indicating whether the WeakAction is static or not.
Initializes an empty instance of the class.
Initializes a new instance of the class.
The action that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Initializes a new instance of the class.
The action's owner.
The action that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Gets a value indicating whether the Action's owner is still alive, or if it was collected
by the Garbage Collector already.
Gets the Action's owner. This object is stored as a
.
The target of the weak reference.
Executes the action. This only happens if the action's owner
is still alive.
Sets the reference that this instance stores to null.
Stores an Action without causing a hard reference
to be created to the Action's owner. The owner can be garbage collected at any time.
The type of the Action's parameter.
Gets the name of the method that this WeakAction represents.
Gets a value indicating whether the Action's owner is still alive, or if it was collected
by the Garbage Collector already.
Initializes a new instance of the WeakAction class.
The action that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Initializes a new instance of the WeakAction class.
The action's owner.
The action that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Executes the action. This only happens if the action's owner
is still alive. The action's parameter is set to default(T).
Executes the action. This only happens if the action's owner
is still alive.
A parameter to be passed to the action.
Executes the action with a parameter of type object. This parameter
will be casted to T. This method implements
and can be useful if you store multiple WeakAction{T} instances but don't know in advance
what type T represents.
The parameter that will be passed to the action after
being casted to T.
Sets all the actions that this WeakAction contains to null,
which is a signal for containing objects that this WeakAction
should be deleted.
Stores a Func<T> without causing a hard reference
to be created to the Func's owner. The owner can be garbage collected at any time.
The type of the result of the Func that will be stored
by this weak reference.
Gets or sets the corresponding to this WeakFunc's
method passed in the constructor.
Get a value indicating whether the WeakFunc is static or not.
Gets the name of the method that this WeakFunc represents.
Gets or sets a WeakReference to this WeakFunc's action's target.
This is not necessarily the same as
, for example if the
method is anonymous.
Saves the as a hard reference. This is
used in relation with this instance's constructor and only if
the constructor's keepTargetAlive parameter is true.
Gets or sets a WeakReference to the target passed when constructing
the WeakFunc. This is not necessarily the same as
, for example if the
method is anonymous.
Initializes an empty instance of the WeakFunc class.
Initializes a new instance of the WeakFunc class.
The Func that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Initializes a new instance of the WeakFunc class.
The Func's owner.
The Func that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Gets a value indicating whether the Func's owner is still alive, or if it was collected
by the Garbage Collector already.
Gets the Func's owner. This object is stored as a
.
Gets the owner of the Func that was passed as parameter.
This is not necessarily the same as
, for example if the
method is anonymous.
Executes the action. This only happens if the Func's owner
is still alive.
The result of the Func stored as reference.
Sets the reference that this instance stores to null.
Stores an Func without causing a hard reference
to be created to the Func's owner. The owner can be garbage collected at any time.
The type of the Func's parameter.
The type of the Func's return value.
Gets or sets the name of the method that this WeakFunc represents.
Gets a value indicating whether the Func's owner is still alive, or if it was collected
by the Garbage Collector already.
Initializes a new instance of the WeakFunc class.
The Func that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Initializes a new instance of the WeakFunc class.
The Func's owner.
The Func that will be associated to this instance.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Executes the Func. This only happens if the Func's owner
is still alive. The Func's parameter is set to default(T).
The result of the Func stored as reference.
Executes the Func. This only happens if the Func's owner
is still alive.
A parameter to be passed to the action.
The result of the Func stored as reference.
Executes the Func with a parameter of type object. This parameter
will be casted to T. This method implements
and can be useful if you store multiple WeakFunc{T} instances but don't know in advance
what type T represents.
The parameter that will be passed to the Func after
being casted to T.
The result of the execution as object, to be casted to T.
Sets all the funcs that this WeakFunc contains to null,
which is a signal for containing objects that this WeakFunc
should be deleted.
Defines a common interface for classes that should be cleaned up,
but without the implications that IDisposable presupposes. An instance
implementing ICleanup can be cleaned up without being
disposed and garbage collected.
Cleans up the instance, for example by saving its state,
removing resources, etc...
Use this class to send a message requesting to display a message box with features
corresponding to this message's properties. The Callback property should be used
to notify the message's sender about the user's choice in the message box.
Typically, you can use this message typ's recipient will be an element of the View,
and the sender will possibly be a ViewModel.
Initializes a new instance of the DialogMessage class.
The text displayed by the message box.
A callback method that should be executed to deliver the result
of the message box to the object that sent the message.
Initializes a new instance of the DialogMessage class.
The message's original sender.
The text displayed by the message box.
A callback method that should be executed to deliver the result
of the message box to the object that sent the message.
Initializes a new instance of the DialogMessage class.
The message's original sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
The text displayed by the message box.
A callback method that should be executed to deliver the result
of the message box to the object that sent the message.
Gets or sets the buttons displayed by the message box.
Gets a callback method that should be executed to deliver the result
of the message box to the object that sent the message.
Gets or sets the caption for the message box.
Gets or sets which result is the default in the message box.
Gets or sets the icon for the message box.
Gets or sets the options for the message box.
Utility method, checks if the property is
null, and if it is not null, executes it.
The result that must be passed
to the dialog message caller.
Passes a generic value (Content) to a recipient.
The type of the Content property.
Initializes a new instance of the GenericMessage class.
The message content.
Initializes a new instance of the GenericMessage class.
The message's sender.
The message content.
Initializes a new instance of the GenericMessage class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
The message content.
Gets or sets the message's content.
The Messenger is a class allowing objects to exchange messages.
Registers a recipient for a type of message TMessage. The action
parameter will be executed when a corresponding message is sent.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
The action that will be executed when a message
of type TMessage is sent. IMPORTANT: Note that closures are not supported at the moment
due to the use of WeakActions (see http://stackoverflow.com/questions/25730530/).
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Registers a recipient for a type of message TMessage.
The action parameter will be executed when a corresponding
message is sent. See the receiveDerivedMessagesToo parameter
for details on how messages deriving from TMessage (or, if TMessage is an interface,
messages implementing TMessage) can be received too.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
A token for a messaging channel. If a recipient registers
using a token, and a sender sends a message using the same token, then this
message will be delivered to the recipient. Other recipients who did not
use a token when registering (or who used a different token) will not
get the message. Similarly, messages sent without any token, or with a different
token, will not be delivered to that recipient.
The action that will be executed when a message
of type TMessage is sent.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Registers a recipient for a type of message TMessage.
The action parameter will be executed when a corresponding
message is sent. See the receiveDerivedMessagesToo parameter
for details on how messages deriving from TMessage (or, if TMessage is an interface,
messages implementing TMessage) can be received too.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
A token for a messaging channel. If a recipient registers
using a token, and a sender sends a message using the same token, then this
message will be delivered to the recipient. Other recipients who did not
use a token when registering (or who used a different token) will not
get the message. Similarly, messages sent without any token, or with a different
token, will not be delivered to that recipient.
If true, message types deriving from
TMessage will also be transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage derive from OrderMessage, registering for OrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
Also, if TMessage is an interface, message types implementing TMessage will also be
transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage implement IOrderMessage, registering for IOrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
The action that will be executed when a message
of type TMessage is sent.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Registers a recipient for a type of message TMessage.
The action parameter will be executed when a corresponding
message is sent. See the receiveDerivedMessagesToo parameter
for details on how messages deriving from TMessage (or, if TMessage is an interface,
messages implementing TMessage) can be received too.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
If true, message types deriving from
TMessage will also be transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage derive from OrderMessage, registering for OrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
Also, if TMessage is an interface, message types implementing TMessage will also be
transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage implement IOrderMessage, registering for IOrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
The action that will be executed when a message
of type TMessage is sent.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Sends a message to registered recipients. The message will
reach all recipients that registered for this message type
using one of the Register methods.
The type of message that will be sent.
The message to send to registered recipients.
Sends a message to registered recipients. The message will
reach only recipients that registered for this message type
using one of the Register methods, and that are
of the targetType.
The type of message that will be sent.
The type of recipients that will receive
the message. The message won't be sent to recipients of another type.
The message to send to registered recipients.
Sends a message to registered recipients. The message will
reach only recipients that registered for this message type
using one of the Register methods, and that are
of the targetType.
The type of message that will be sent.
The message to send to registered recipients.
A token for a messaging channel. If a recipient registers
using a token, and a sender sends a message using the same token, then this
message will be delivered to the recipient. Other recipients who did not
use a token when registering (or who used a different token) will not
get the message. Similarly, messages sent without any token, or with a different
token, will not be delivered to that recipient.
Unregisters a messager recipient completely. After this method
is executed, the recipient will not receive any messages anymore.
The recipient that must be unregistered.
Unregisters a message recipient for a given type of messages only.
After this method is executed, the recipient will not receive messages
of type TMessage anymore, but will still receive other message types (if it
registered for them previously).
The type of messages that the recipient wants
to unregister from.
The recipient that must be unregistered.
Unregisters a message recipient for a given type of messages only and for a given token.
After this method is executed, the recipient will not receive messages
of type TMessage anymore with the given token, but will still receive other message types
or messages with other tokens (if it registered for them previously).
The recipient that must be unregistered.
The token for which the recipient must be unregistered.
The type of messages that the recipient wants
to unregister from.
Unregisters a message recipient for a given type of messages and for
a given action. Other message types will still be transmitted to the
recipient (if it registered for them previously). Other actions that have
been registered for the message type TMessage and for the given recipient (if
available) will also remain available.
The type of messages that the recipient wants
to unregister from.
The recipient that must be unregistered.
The action that must be unregistered for
the recipient and for the message type TMessage.
Unregisters a message recipient for a given type of messages, for
a given action and a given token. Other message types will still be transmitted to the
recipient (if it registered for them previously). Other actions that have
been registered for the message type TMessage, for the given recipient and other tokens (if
available) will also remain available.
The type of messages that the recipient wants
to unregister from.
The recipient that must be unregistered.
The token for which the recipient must be unregistered.
The action that must be unregistered for
the recipient and for the message type TMessage.
Base class for all messages broadcasted by the Messenger.
You can create your own message types by extending this class.
Initializes a new instance of the MessageBase class.
Initializes a new instance of the MessageBase class.
The message's original sender.
Initializes a new instance of the MessageBase class.
The message's original sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
Gets or sets the message's sender.
Gets or sets the message's intended target. This property can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
The Messenger is a class allowing objects to exchange messages.
Gets the Messenger's default instance, allowing
to register and send messages in a static manner.
Registers a recipient for a type of message TMessage. The action
parameter will be executed when a corresponding message is sent.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
The action that will be executed when a message
of type TMessage is sent. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Registers a recipient for a type of message TMessage.
The action parameter will be executed when a corresponding
message is sent. See the receiveDerivedMessagesToo parameter
for details on how messages deriving from TMessage (or, if TMessage is an interface,
messages implementing TMessage) can be received too.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
However if you use closures and set keepTargetAlive to true, you might
cause a memory leak if you don't call when you are cleaning up.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
A token for a messaging channel. If a recipient registers
using a token, and a sender sends a message using the same token, then this
message will be delivered to the recipient. Other recipients who did not
use a token when registering (or who used a different token) will not
get the message. Similarly, messages sent without any token, or with a different
token, will not be delivered to that recipient.
The action that will be executed when a message
of type TMessage is sent. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Registers a recipient for a type of message TMessage.
The action parameter will be executed when a corresponding
message is sent. See the receiveDerivedMessagesToo parameter
for details on how messages deriving from TMessage (or, if TMessage is an interface,
messages implementing TMessage) can be received too.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
A token for a messaging channel. If a recipient registers
using a token, and a sender sends a message using the same token, then this
message will be delivered to the recipient. Other recipients who did not
use a token when registering (or who used a different token) will not
get the message. Similarly, messages sent without any token, or with a different
token, will not be delivered to that recipient.
If true, message types deriving from
TMessage will also be transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage derive from OrderMessage, registering for OrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
Also, if TMessage is an interface, message types implementing TMessage will also be
transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage implement IOrderMessage, registering for IOrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
The action that will be executed when a message
of type TMessage is sent. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Registers a recipient for a type of message TMessage.
The action parameter will be executed when a corresponding
message is sent. See the receiveDerivedMessagesToo parameter
for details on how messages deriving from TMessage (or, if TMessage is an interface,
messages implementing TMessage) can be received too.
Registering a recipient does not create a hard reference to it,
so if this recipient is deleted, no memory leak is caused.
The type of message that the recipient registers
for.
The recipient that will receive the messages.
If true, message types deriving from
TMessage will also be transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage derive from OrderMessage, registering for OrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
Also, if TMessage is an interface, message types implementing TMessage will also be
transmitted to the recipient. For example, if a SendOrderMessage
and an ExecuteOrderMessage implement IOrderMessage, registering for IOrderMessage
and setting receiveDerivedMessagesToo to true will send SendOrderMessage
and ExecuteOrderMessage to the recipient that registered.
The action that will be executed when a message
of type TMessage is sent. IMPORTANT: If the action causes a closure,
you must set keepTargetAlive to true to avoid side effects.
If true, the target of the Action will
be kept as a hard reference, which might cause a memory leak. You should only set this
parameter to true if the action is using closures. See
http://galasoft.ch/s/mvvmweakaction.
Sends a message to registered recipients. The message will
reach all recipients that registered for this message type
using one of the Register methods.
The type of message that will be sent.
The message to send to registered recipients.
Sends a message to registered recipients. The message will
reach only recipients that registered for this message type
using one of the Register methods, and that are
of the targetType.
The type of message that will be sent.
The type of recipients that will receive
the message. The message won't be sent to recipients of another type.
The message to send to registered recipients.
Sends a message to registered recipients. The message will
reach only recipients that registered for this message type
using one of the Register methods, and that are
of the targetType.
The type of message that will be sent.
The message to send to registered recipients.
A token for a messaging channel. If a recipient registers
using a token, and a sender sends a message using the same token, then this
message will be delivered to the recipient. Other recipients who did not
use a token when registering (or who used a different token) will not
get the message. Similarly, messages sent without any token, or with a different
token, will not be delivered to that recipient.
Unregisters a messager recipient completely. After this method
is executed, the recipient will not receive any messages anymore.
The recipient that must be unregistered.
Unregisters a message recipient for a given type of messages only.
After this method is executed, the recipient will not receive messages
of type TMessage anymore, but will still receive other message types (if it
registered for them previously).
The recipient that must be unregistered.
The type of messages that the recipient wants
to unregister from.
Unregisters a message recipient for a given type of messages only and for a given token.
After this method is executed, the recipient will not receive messages
of type TMessage anymore with the given token, but will still receive other message types
or messages with other tokens (if it registered for them previously).
The recipient that must be unregistered.
The token for which the recipient must be unregistered.
The type of messages that the recipient wants
to unregister from.
Unregisters a message recipient for a given type of messages and for
a given action. Other message types will still be transmitted to the
recipient (if it registered for them previously). Other actions that have
been registered for the message type TMessage and for the given recipient (if
available) will also remain available.
The type of messages that the recipient wants
to unregister from.
The recipient that must be unregistered.
The action that must be unregistered for
the recipient and for the message type TMessage.
Unregisters a message recipient for a given type of messages, for
a given action and a given token. Other message types will still be transmitted to the
recipient (if it registered for them previously). Other actions that have
been registered for the message type TMessage, for the given recipient and other tokens (if
available) will also remain available.
The type of messages that the recipient wants
to unregister from.
The recipient that must be unregistered.
The token for which the recipient must be unregistered.
The action that must be unregistered for
the recipient and for the message type TMessage.
Provides a way to override the Messenger.Default instance with
a custom instance, for example for unit testing purposes.
The instance that will be used as Messenger.Default.
Sets the Messenger's default (static) instance to null.
Provides a non-static access to the static method.
Sets the Messenger's default (static) instance to null.
Notifies the Messenger that the lists of recipients should
be scanned and cleaned up.
Since recipients are stored as ,
recipients can be garbage collected even though the Messenger keeps
them in a list. During the cleanup operation, all "dead"
recipients are removed from the lists. Since this operation
can take a moment, it is only executed when the application is
idle. For this reason, a user of the Messenger class should use
instead of forcing one with the
method.
Scans the recipients' lists for "dead" instances and removes them.
Since recipients are stored as ,
recipients can be garbage collected even though the Messenger keeps
them in a list. During the cleanup operation, all "dead"
recipients are removed from the lists. Since this operation
can take a moment, it is only executed when the application is
idle. For this reason, a user of the Messenger class should use
instead of forcing one with the
method.
Passes a string message (Notification) to a recipient.
Typically, notifications are defined as unique strings in a static class. To define
a unique string, you can use Guid.NewGuid().ToString() or any other unique
identifier.
Initializes a new instance of the NotificationMessage class.
A string containing any arbitrary message to be
passed to recipient(s)
Initializes a new instance of the NotificationMessage class.
The message's sender.
A string containing any arbitrary message to be
passed to recipient(s)
Initializes a new instance of the NotificationMessage class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
A string containing any arbitrary message to be
passed to recipient(s)
Gets a string containing any arbitrary message to be
passed to recipient(s).
Provides a message class with a built-in callback. When the recipient
is done processing the message, it can execute the callback to
notify the sender that it is done. Use the
method to execute the callback.
Initializes a new instance of the
class.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Initializes a new instance of the
class.
The message's sender.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Initializes a new instance of the
class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Executes the callback that was provided with the message.
Provides a message class with a built-in callback. When the recipient
is done processing the message, it can execute the callback to
notify the sender that it is done. Use the
method to execute the callback. The callback method has one parameter.
.
The type of the callback method's
only parameter.
Initializes a new instance of the
class.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Initializes a new instance of the
class.
The message's sender.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Initializes a new instance of the
class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Executes the callback that was provided with the message.
A parameter requested by the message's
sender and providing additional information on the recipient's
state.
Passes a string message (Notification) and a generic value (Content) to a recipient.
The type of the Content property.
Initializes a new instance of the NotificationMessage class.
A value to be passed to recipient(s).
A string containing any arbitrary message to be
passed to recipient(s)
Initializes a new instance of the NotificationMessage class.
The message's sender.
A value to be passed to recipient(s).
A string containing any arbitrary message to be
passed to recipient(s)
Initializes a new instance of the NotificationMessage class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
A value to be passed to recipient(s).
A string containing any arbitrary message to be
passed to recipient(s)
Gets a string containing any arbitrary message to be
passed to recipient(s).
Provides a message class with a built-in callback. When the recipient
is done processing the message, it can execute the callback to
notify the sender that it is done. Use the
method to execute the callback. The callback method has one parameter.
and
.
Initializes a new instance of the class.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Initializes a new instance of the class.
The message's sender.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Initializes a new instance of the class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
An arbitrary string that will be
carried by the message.
The callback method that can be executed
by the recipient to notify the sender that the message has been
processed.
Executes the callback that was provided with the message with an
arbitrary number of parameters.
A number of parameters that will
be passed to the callback method.
The object returned by the callback method.
Passes a string property name (PropertyName) and a generic value
( and ) to a recipient.
This message type can be used to propagate a PropertyChanged event to
a recipient using the messenging system.
The type of the OldValue and NewValue property.
Initializes a new instance of the class.
The message's sender.
The property's value before the change occurred.
The property's value after the change occurred.
The name of the property that changed.
Initializes a new instance of the class.
The property's value before the change occurred.
The property's value after the change occurred.
The name of the property that changed.
Initializes a new instance of the class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
The property's value before the change occurred.
The property's value after the change occurred.
The name of the property that changed.
Gets the value that the property has after the change.
Gets the value that the property had before the change.
Basis class for the class. This
class allows a recipient to register for all PropertyChangedMessages without
having to specify the type T.
Initializes a new instance of the class.
The message's sender.
The name of the property that changed.
Initializes a new instance of the class.
The message's sender.
The message's intended target. This parameter can be used
to give an indication as to whom the message was intended for. Of course
this is only an indication, amd may be null.
The name of the property that changed.
Initializes a new instance of the class.
The name of the property that changed.
Gets or sets the name of the property that changed.
A base class for objects of which the properties must be observable.
Occurs after a property value changes.
Provides access to the PropertyChanged event handler to derived classes.
Occurs before a property value changes.
Provides access to the PropertyChanging event handler to derived classes.
Verifies that a property name exists in this ViewModel. This method
can be called before the property is used, for instance before
calling RaisePropertyChanged. It avoids errors when a property name
is changed but some places are missed.
This method is only active in DEBUG mode.
The name of the property that will be
checked.
Raises the PropertyChanging event if needed.
If the propertyName parameter
does not correspond to an existing property on the current class, an
exception is thrown in DEBUG configuration only.
The name of the property that
changed.
Raises the PropertyChanged event if needed.
If the propertyName parameter
does not correspond to an existing property on the current class, an
exception is thrown in DEBUG configuration only.
The name of the property that
changed.
Raises the PropertyChanging event if needed.
The type of the property that
changes.
An expression identifying the property
that changes.
Raises the PropertyChanged event if needed.
The type of the property that
changed.
An expression identifying the property
that changed.
Extracts the name of a property from an expression.
The type of the property.
An expression returning the property's name.
The name of the property returned by the expression.
If the expression is null.
If the expression does not represent a property.
Assigns a new value to the property. Then, raises the
PropertyChanged event if needed.
The type of the property that
changed.
An expression identifying the property
that changed.
The field storing the property's value.
The property's value after the change
occurred.
True if the PropertyChanged event has been raised,
false otherwise. The event is not raised if the old
value is equal to the new value.
Assigns a new value to the property. Then, raises the
PropertyChanged event if needed.
The type of the property that
changed.
The name of the property that
changed.
The field storing the property's value.
The property's value after the change
occurred.
True if the PropertyChanged event has been raised,
false otherwise. The event is not raised if the old
value is equal to the new value.
A base class for the ViewModel classes in the MVVM pattern.
Initializes a new instance of the ViewModelBase class.
Initializes a new instance of the ViewModelBase class.
An instance of a
used to broadcast messages to other objects. If null, this class
will attempt to broadcast using the Messenger's default
instance.
Gets a value indicating whether the control is in design mode
(running under Blend or Visual Studio).
Gets a value indicating whether the control is in design mode
(running in Blend or Visual Studio).
Gets or sets an instance of a used to
broadcast messages to other objects. If null, this class will
attempt to broadcast using the Messenger's default instance.
Unregisters this instance from the Messenger class.
To cleanup additional resources, override this method, clean
up and then call base.Cleanup().
Broadcasts a PropertyChangedMessage using either the instance of
the Messenger that was passed to this class (if available)
or the Messenger's default instance.
The type of the property that
changed.
The value of the property before it
changed.
The value of the property after it
changed.
The name of the property that
changed.
Raises the PropertyChanged event if needed, and broadcasts a
PropertyChangedMessage using the Messenger instance (or the
static default instance if no Messenger instance is available).
The type of the property that
changed.
The name of the property that
changed.
The property's value before the change
occurred.
The property's value after the change
occurred.
If true, a PropertyChangedMessage will
be broadcasted. If false, only the event will be raised.
If the propertyName parameter
does not correspond to an existing property on the current class, an
exception is thrown in DEBUG configuration only.
Raises the PropertyChanged event if needed, and broadcasts a
PropertyChangedMessage using the Messenger instance (or the
static default instance if no Messenger instance is available).
The type of the property that
changed.
An expression identifying the property
that changed.
The property's value before the change
occurred.
The property's value after the change
occurred.
If true, a PropertyChangedMessage will
be broadcasted. If false, only the event will be raised.
Assigns a new value to the property. Then, raises the
PropertyChanged event if needed, and broadcasts a
PropertyChangedMessage using the Messenger instance (or the
static default instance if no Messenger instance is available).
The type of the property that
changed.
An expression identifying the property
that changed.
The field storing the property's value.
The property's value after the change
occurred.
If true, a PropertyChangedMessage will
be broadcasted. If false, only the event will be raised.
True if the PropertyChanged event was raised, false otherwise.
Assigns a new value to the property. Then, raises the
PropertyChanged event if needed, and broadcasts a
PropertyChangedMessage using the Messenger instance (or the
static default instance if no Messenger instance is available).
The type of the property that
changed.
The name of the property that
changed.
The field storing the property's value.
The property's value after the change
occurred.
If true, a PropertyChangedMessage will
be broadcasted. If false, only the event will be raised.
True if the PropertyChanged event was raised, false otherwise.
An interface defining how dialogs should
be displayed in various frameworks such as Windows,
Windows Phone, Android, iOS etc.
Displays information about an error.
The message to be shown to the user.
The title of the dialog box. This may be null.
The text shown in the only button
in the dialog box. If left null, the text "OK" will be used.
A callback that should be executed after
the dialog box is closed by the user.
A Task allowing this async method to be awaited.
Displays information about an error.
The exception of which the message must be shown to the user.
The title of the dialog box. This may be null.
The text shown in the only button
in the dialog box. If left null, the text "OK" will be used.
A callback that should be executed after
the dialog box is closed by the user.
A Task allowing this async method to be awaited.
Displays information to the user. The dialog box will have only
one button with the text "OK".
The message to be shown to the user.
The title of the dialog box. This may be null.
A Task allowing this async method to be awaited.
Displays information to the user. The dialog box will have only
one button.
The message to be shown to the user.
The title of the dialog box. This may be null.
The text shown in the only button
in the dialog box. If left null, the text "OK" will be used.
A callback that should be executed after
the dialog box is closed by the user.
A Task allowing this async method to be awaited.
Displays information to the user. The dialog box will have only
one button.
The message to be shown to the user.
The title of the dialog box. This may be null.
The text shown in the "confirm" button
in the dialog box. If left null, the text "OK" will be used.
The text shown in the "cancel" button
in the dialog box. If left null, the text "Cancel" will be used.
A callback that should be executed after
the dialog box is closed by the user. The callback method will get a boolean
parameter indicating if the "confirm" button (true) or the "cancel" button
(false) was pressed by the user.
A Task allowing this async method to be awaited. The task will return
true or false depending on the dialog result.
Displays information to the user in a simple dialog box. The dialog box will have only
one button with the text "OK". This method should be used for debugging purposes.
The message to be shown to the user.
The title of the dialog box. This may be null.
A Task allowing this async method to be awaited.
An interface defining how navigation between pages should
be performed in various frameworks such as Windows,
Windows Phone, Android, iOS etc.
The key corresponding to the currently displayed page.
If possible, instructs the navigation service
to discard the current page and display the previous page
on the navigation stack.
Instructs the navigation service to display a new page
corresponding to the given key. Depending on the platforms,
the navigation service might have to be configured with a
key/page list.
The key corresponding to the page
that should be displayed.
Instructs the navigation service to display a new page
corresponding to the given key, and passes a parameter
to the new page.
Depending on the platforms, the navigation service might
have to be Configure with a key/page list.
The key corresponding to the page
that should be displayed.
The parameter that should be passed
to the new page.
Helper class for dispatcher operations on the UI thread.
Gets a reference to the UI thread's dispatcher, after the
method has been called on the UI thread.
Executes an action on the UI thread. If this method is called
from the UI thread, the action is executed immendiately. If the
method is called from another thread, the action will be enqueued
on the UI thread's dispatcher and executed asynchronously.
For additional operations on the UI thread, you can get a
reference to the UI thread's dispatcher thanks to the property
.
The action that will be executed on the UI
thread.
Invokes an action asynchronously on the UI thread.
The action that must be executed.
An object, which is returned immediately after BeginInvoke is called, that can be used to interact
with the delegate as it is pending execution in the event queue.
This method should be called once on the UI thread to ensure that
the property is initialized.
In a Silverlight application, call this method in the
Application_Startup event handler, after the MainPage is constructed.
In WPF, call this method on the static App() constructor.
Resets the class by deleting the