Show / Hide Table of Contents

Class CommandBase

Clase base para las implementaciones de la interfaz ICommand en MCART.

Inheritance
object
CommandBase
ObservingCommand
SimpleCommand
Implements
ICommand
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: TheXDS.MCART.Types.Base
Assembly: MCART.Mvvm.dll
Syntax
public abstract class CommandBase : ICommand

Constructors

| Edit this page View Source

CommandBase(Action<object?>)

Clase base para las implementaciones de la interfaz ICommand en MCART.

Declaration
protected CommandBase(Action<object?> action)
Parameters
Type Name Description
Action<object> action

Acción a asociar a este comando.

Methods

| Edit this page View Source

CanExecute()

Define el método que determina si el comando puede ejecutarse en su estado actual.

Declaration
public bool CanExecute()
Returns
Type Description
bool

true si se puede ejecutar este comando; de lo contrario, false.

| Edit this page View Source

CanExecute(object?)

Define el método que determina si el comando puede ejecutarse en su estado actual.

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

Datos que usa el comando. Si el comando no exige pasar los datos, se puede establecer este objeto en null.

Returns
Type Description
bool

true si se puede ejecutar este comando; de lo contrario, false.

| Edit this page View Source

Execute()

Ejecuta el método asociado a la invocación de este comando.

Declaration
public void Execute()
| Edit this page View Source

Execute(object?)

Ejecuta el método asociado a la invocación de este comando.

Declaration
public virtual void Execute(object? parameter)
Parameters
Type Name Description
object parameter

Datos que usa el comando. Si el comando no exige pasar los datos, se puede establecer este objeto en null.

| Edit this page View Source

RaiseCanExecuteChanged()

Invoca el evento CanExecuteChanged.

Declaration
protected void RaiseCanExecuteChanged()
| Edit this page View Source

TryExecute()

Comprueba si la acción puede ejecutarse, y de ser así, la ejecuta.

Declaration
public bool TryExecute()
Returns
Type Description
bool

true si se ha ejecutado la acción luego de comprobar la posibilidad de ejecutarla, false en caso contrario.

| Edit this page View Source

TryExecute(object?)

Comprueba si la acción puede ejecutarse, y de ser así, la ejecuta.

Declaration
public bool TryExecute(object? arg)
Parameters
Type Name Description
object arg

Argumentos a utilizar para comprobar y para ejecutar la acción asociada a este comando.

Returns
Type Description
bool

true si se ha ejecutado la acción luego de comprobar la posibilidad de ejecutarla, false en caso contrario.

Events

| Edit this page View Source

CanExecuteChanged

Se produce cuando hay cambios que influyen en si el comando debería ejecutarse o no.

Declaration
public event EventHandler? CanExecuteChanged
Event Type
Type Description
EventHandler

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