RelayCommand Class
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
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'.
Inheritance Hierarchy
System.Object
Microsoft.TeamFoundation.MVVM.NotifyPropertyChangedDispatcherObject
Microsoft.TeamFoundation.MVVM.RelayCommand
Namespace: Microsoft.TeamFoundation.MVVM
Assembly: Microsoft.TeamFoundation.Controls (in Microsoft.TeamFoundation.Controls.dll)
Syntax
'Declaration
Public Class RelayCommand _
Inherits NotifyPropertyChangedDispatcherObject _
Implements IOwnedCommand, ICommand
public class RelayCommand : NotifyPropertyChangedDispatcherObject,
IOwnedCommand, ICommand
public ref class RelayCommand : public NotifyPropertyChangedDispatcherObject,
IOwnedCommand, ICommand
type RelayCommand =
class
inherit NotifyPropertyChangedDispatcherObject
interface IOwnedCommand
interface ICommand
end
public class RelayCommand extends NotifyPropertyChangedDispatcherObject implements IOwnedCommand, ICommand
The RelayCommand type exposes the following members.
Constructors
Name | Description | |
---|---|---|
RelayCommand(Action) | Creates a new command that can always execute. | |
RelayCommand(Action<Object>) | Creates a new command that can always execute. | |
RelayCommand(Action<Object>, Predicate<Object>) | Creates a new command. |
Top
Properties
Name | Description | |
---|---|---|
Dispatcher | Dispatcher associated with this object. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
IsExecuting | True if command is executing, false otherwise. |
Top
Methods
Name | Description | |
---|---|---|
AddDependencySource(String, INotifyCollectionChanged) | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
AddDependencySource(String, INotifyPropertyChanged) | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
CanExecute | ||
CheckAccessBeginExecute | Executes the specified action on a thread associated with object's dispatcher. This invokes a BeginInvoke on the Dispatcher, does not wait for the action to complete -- returns immediately. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
CheckAccessExecute(Action) | Executes the specified action on a thread associated with object's dispatcher. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
CheckAccessExecute<TResult>(Func<TResult>) | Executes the specified action on a thread associated with object's dispatcher. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Execute | ||
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetDependencySourceName(INotifyCollectionChanged) | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
GetDependencySourceName(INotifyPropertyChanged) | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
RaiseCanExecuteChanged | ||
RaisePropertyChanged | Raises PropertyChanged event. This method can only be called on the thread associated with this object's dispatcher. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
ReceiveWeakEvent | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
RemoveDependencySource(String, INotifyCollectionChanged) | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
RemoveDependencySource(String, INotifyPropertyChanged) | (Inherited from NotifyPropertyChangedDispatcherObject.) | |
SetAndRaisePropertyChanged(Boolean, Boolean, String) | A helper method that sets property value and raises PropertyChanged event if the value has changed. Optimized implementation for System.Boolean type. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
SetAndRaisePropertyChanged(Int32, Int32, String) | A helper method that sets property value and raises PropertyChanged event if the value has changed. Optimized implementation for System.Int32 type. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
SetAndRaisePropertyChanged(String, String, String) | A helper method that sets property value and raises PropertyChanged event if the value has changed. Optimized implementation for string type. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
SetAndRaisePropertyChanged<T>(T, T, String) | A helper method that sets property value and raises PropertyChanged event if the value has changed. (Inherited from NotifyPropertyChangedDispatcherObject.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
VerifyAccess | Enforces that the calling thread has access to this object. (Inherited from NotifyPropertyChangedDispatcherObject.) |
Top
Events
Name | Description | |
---|---|---|
CanExecuteChanged | Raised when CanExecute changes. | |
PropertyChanged | Occurs when a property value changes. (Inherited from NotifyPropertyChangedDispatcherObject.) |
Top
Fields
Name | Description | |
---|---|---|
IsExecutingProperty |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IWeakEventListener.ReceiveWeakEvent | (Inherited from NotifyPropertyChangedDispatcherObject.) |
Top
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.