Show / Hide Table of Contents

Class SimpleCommand

Describes a simplified command that can be used in a ViewModelBase.

Inheritance
object
CommandBase
SimpleCommand
SimpleCommand<T>
Implements
ICommand
Inherited Members
CommandBase.CanExecuteChanged
CommandBase.CanExecute()
CommandBase.Execute(object)
CommandBase.Execute()
CommandBase.TryExecute(object)
CommandBase.TryExecute()
CommandBase.RaiseCanExecuteChanged()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Component
Assembly: MCART.Mvvm.dll
Syntax
public class SimpleCommand : CommandBase, ICommand

Constructors

| Edit this page View Source

SimpleCommand(Action)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Action action)
Parameters
Type Name Description
Action action

Action to be executed.

| Edit this page View Source

SimpleCommand(Action, bool)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Action action, bool canExecute)
Parameters
Type Name Description
Action action

Action to be executed.

bool canExecute

Indicates if the command will be executable by default.

| Edit this page View Source

SimpleCommand(Action<object?>)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Action<object?> action)
Parameters
Type Name Description
Action<object> action

Action to be executed.

| Edit this page View Source

SimpleCommand(Action<object?>, bool)

Describes a simplified command that can be used in a ViewModelBase.

Declaration
public SimpleCommand(Action<object?> action, bool canExecute)
Parameters
Type Name Description
Action<object> action

Action to execute.

bool canExecute

Indicates if the command will be executable by default.

| Edit this page View Source

SimpleCommand(Func<object?, Task>)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Func<object?, Task> task)
Parameters
Type Name Description
Func<object, Task> task

Task to be executed.

| Edit this page View Source

SimpleCommand(Func<object?, Task>, bool)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Func<object?, Task> task, bool canExecute)
Parameters
Type Name Description
Func<object, Task> task

Task to be executed.

bool canExecute

Indicates if the command will be executable by default.

| Edit this page View Source

SimpleCommand(Func<Task>)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Func<Task> task)
Parameters
Type Name Description
Func<Task> task

Task to be executed.

| Edit this page View Source

SimpleCommand(Func<Task>, bool)

Initializes a new instance of the SimpleCommand class.

Declaration
public SimpleCommand(Func<Task> task, bool canExecute)
Parameters
Type Name Description
Func<Task> task

Task to be executed.

bool canExecute

Indicates if the command will be executable by default.

Methods

| Edit this page View Source

CanExecute(object?)

Checks if the current command can be executed.

Declaration
public override bool CanExecute(object? parameter)
Parameters
Type Name Description
object parameter

DCommand parameters. If the command does not require parameters, this value can be set to null.

Returns
Type Description
bool

true if the command can be executed, false otherwise.

Overrides
CommandBase.CanExecute(object?)
| Edit this page View Source

SetCanExecute(bool)

Manually sets a value that determines if this command can be executed.

Declaration
public void SetCanExecute(bool canExecute)
Parameters
Type Name Description
bool canExecute

Value that indicates if the command can be executed.

Implements

ICommand

Extension Methods

Objects.ShallowCopyTo(object, object, Type)
ObjectExtensions.FieldsOf<T>(object)
ObjectExtensions.GetAttribute<T>(object)
ObjectExtensions.GetAttributes<T>(object)
ObjectExtensions.HasAttrValue<TAttribute, TValue>(object, out TValue)
ObjectExtensions.HasAttribute<T>(object)
ObjectExtensions.HasAttribute<T>(object, out T?)
ObjectExtensions.HasAttributes<T>(object, out IEnumerable<T>?)
ObjectExtensions.Is(object?, object?)
ObjectExtensions.IsEither(object, IEnumerable)
ObjectExtensions.IsEither(object, params object[])
ObjectExtensions.IsNeither(object, IEnumerable)
ObjectExtensions.IsNeither(object, params object[])
ObjectExtensions.IsNot(object?, object?)
ObjectExtensions.PropertiesOf<T>(object)
ObjectExtensions.WhichAre(object, IEnumerable<object>)
ObjectExtensions.WhichAre(object, params object[])
Common.IfNotNull<T>(T?, Action<T>)
Objects.Itself<T>(T)
Objects.ShallowCopyTo<T>(T, T)
CollectionExtensions.PushInto<TItem, TCollection>(TItem, ICollection<TCollection>)
DictionaryExtensions.PushInto<TKey, TValue>(TValue, TKey, IDictionary<TKey, TValue>)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX