![]() |
Paradox Game Engine
v1.0.0 beta06
|
An implementation of CommandBase that route Execute calls to a given anonymous method. More...
Public Member Functions | |
AnonymousCommand (IViewModelServiceProvider serviceProvider, Action action) | |
Initializes a new instance of the AnonymousCommand class. More... | |
AnonymousCommand (IViewModelServiceProvider serviceProvider, Action action, Func< bool > canExecute) | |
Initializes a new instance of the AnonymousCommand class. More... | |
AnonymousCommand (IViewModelServiceProvider serviceProvider, Action< object > action) | |
Initializes a new instance of the AnonymousCommand class. More... | |
AnonymousCommand (IViewModelServiceProvider serviceProvider, Action< object > action, Func< bool > canExecute) | |
Initializes a new instance of the AnonymousCommand class. More... | |
override void | Execute (object parameter) |
Executes the command, and thus the anonymous method provided to the constructor. More... | |
override bool | CanExecute (object parameter) |
Indicates whether the command can be executed. Returns true if CommandBase.IsEnabled is true and either a Func{Bool} was provided to the constructor, and this function returns true , or no Func{Bool} was provided (or a null function). More... | |
![]() | |
bool | CanExecute () |
Invokes CanExecute(object) with a null argument. More... | |
void | Execute () |
Invokes the Execute(object) command with a null argument. More... | |
Additional Inherited Members | |||
![]() | |||
IViewModelServiceProvider | ServiceProvider = ViewModelServiceProvider.NullServiceProvider | ||
An IViewModelServiceProvider that allows to retrieve various service objects. More... | |||
![]() | |||
CommandBase (IViewModelServiceProvider serviceProvider) | |||
Initializes a new instance of the CommandBase class. More... | |||
![]() | |||
DispatcherViewModel (IViewModelServiceProvider serviceProvider) | |||
Initializes a new instance of the DispatcherViewModel class. More... | |||
override void | OnPropertyChanging (params string[] propertyNames) | ||
This method will raise the PropertyChanging for each of the property name passed as argument.
| |||
override void | OnPropertyChanged (params string[] propertyNames) | ||
This method will raise the PropertyChanged for each of the property name passed as argument.
| |||
![]() | |||
ViewModelBase () | |||
ViewModelBase (IViewModelServiceProvider serviceProvider) | |||
bool | SetValue< T > (ref T field, T value, [CallerMemberName]string propertyName=null) | ||
Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging event will be raised first, then the field value will be modified, and finally the PropertyChanged event will be raised. More... | |||
bool | SetValue< T > (ref T field, T value, params string[] propertyNames) | ||
Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging will be raised first, then the field value will be modified, and finally the PropertyChanged event will be raised. More... | |||
bool | SetValue< T > (ref T field, T value, Action updateAction, [CallerMemberName]string propertyName=null) | ||
Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging event will be raised first, then the field value will be modified. The given update action will be executed and finally the PropertyChanged event will be raised. More... | |||
virtual bool | SetValue< T > (ref T field, T value, Action updateAction, params string[] propertyNames) | ||
Sets the value of a field to the given value. Both values are compared with the default EqualityComparer{T}, and if they are equals, this method does nothing. If they are different, the PropertyChanging event will be raised first, then the field value will be modified. The given update action will be executed and finally the PropertyChanged event will be raised. More... | |||
bool | SetValue (Action updateAction, [CallerMemberName]string propertyName=null) | ||
Manages a property modification and its notifications. This method will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More... | |||
bool | SetValue (Action updateAction, params string[] propertyNames) | ||
Manages a property modification and its notifications. This method will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More... | |||
bool | SetValue (Func< bool > hasChangedFunction, Action updateAction, [CallerMemberName]string propertyName=null) | ||
Manages a property modification and its notifications. A function is provided to check whether the new value is different from the current one. This function will be invoked by this method, and if it returns True , it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More... | |||
bool | SetValue (bool hasChanged, Action updateAction, [CallerMemberName]string propertyName=null) | ||
Manages a property modification and its notifications. The first parameter hasChanged should indicate whether the property should actuallybe updated. If this parameter is True , it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More... | |||
bool | SetValue (bool hasChanged, Action updateAction, params string[] propertyNames) | ||
Manages a property modification and its notifications. The first parameter hasChanged should indicate whether the property should actuallybe updated. If this parameter is True , it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More... | |||
virtual bool | SetValue (Func< bool > hasChangedFunction, Action updateAction, params string[] propertyNames) | ||
Manages a property modification and its notifications. A function is provided to check whether the new value is different from the current one. This function will be invoked by this method, and if it returns True , it will invoke the provided update action. The PropertyChanging event will be raised prior to the update action, and the PropertyChanged event will be raised after. More... | |||
![]() | |||
List< Tuple< string, string > > | DependentProperties = new List<Tuple<string, string>>() | ||
A list of couple of property names that are dependent. For each couple of this list, if the first property name is notified as being changed, then the second property name will also be notified has being changed. More... | |||
![]() | |||
bool | IsEnabled [get, set] | ||
![]() | |||
IDispatcherService | Dispatcher [get, set] | ||
Gets a dispatcher that is capable of executing code in the UI thread. More... | |||
![]() | |||
bool | IsEnabled [get, set] | ||
Indicates whether the command can be executed or not. More... | |||
![]() | |||
EventHandler | CanExecuteChanged | ||
![]() | |||
PropertyChangingEventHandler | PropertyChanging | ||
PropertyChangedEventHandler | PropertyChanged | ||
An implementation of CommandBase that route Execute calls to a given anonymous method.
Definition at line 14 of file AnonymousCommand.cs.
SiliconStudio.Presentation.Commands.AnonymousCommand.AnonymousCommand | ( | IViewModelServiceProvider | serviceProvider, |
Action | action | ||
) |
Initializes a new instance of the AnonymousCommand class.
serviceProvider | A service provider that can provide a IDispatcherService to use for this view model. |
action | An anonymous method that will be called each time the command is executed. |
Definition at line 24 of file AnonymousCommand.cs.
SiliconStudio.Presentation.Commands.AnonymousCommand.AnonymousCommand | ( | IViewModelServiceProvider | serviceProvider, |
Action | action, | ||
Func< bool > | canExecute | ||
) |
Initializes a new instance of the AnonymousCommand class.
serviceProvider | A service provider that can provide a IDispatcherService to use for this view model. |
action | An anonymous method that will be called each time the command is executed. |
canExecute | An anonymous method that will be called each time the command CommandBase.CanExecute(object) method is invoked. |
Definition at line 39 of file AnonymousCommand.cs.
SiliconStudio.Presentation.Commands.AnonymousCommand.AnonymousCommand | ( | IViewModelServiceProvider | serviceProvider, |
Action< object > | action | ||
) |
Initializes a new instance of the AnonymousCommand class.
serviceProvider | A service provider that can provide a IDispatcherService to use for this view model. |
action | An anonymous method that will be called each time the command is executed. |
Definition at line 54 of file AnonymousCommand.cs.
SiliconStudio.Presentation.Commands.AnonymousCommand.AnonymousCommand | ( | IViewModelServiceProvider | serviceProvider, |
Action< object > | action, | ||
Func< bool > | canExecute | ||
) |
Initializes a new instance of the AnonymousCommand class.
serviceProvider | A service provider that can provide a IDispatcherService to use for this view model. |
action | An anonymous method that will be called each time the command is executed. |
canExecute | An anonymous method that will be called each time the command CommandBase.CanExecute(object) method is invoked. |
Definition at line 69 of file AnonymousCommand.cs.
|
virtual |
Indicates whether the command can be executed. Returns true
if CommandBase.IsEnabled is true
and either a Func{Bool} was provided to the constructor, and this function returns true
, or no Func{Bool} was provided (or a null
function).
parameter | The command parameter. |
true
if the command can be executed, false
otherwise.Reimplemented from SiliconStudio.Presentation.Commands.CommandBase.
Definition at line 95 of file AnonymousCommand.cs.
|
virtual |
Executes the command, and thus the anonymous method provided to the constructor.
parameter | The command parameter. |
Implements SiliconStudio.Presentation.Commands.CommandBase.
Definition at line 84 of file AnonymousCommand.cs.