menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DelegateCommand<T> - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DelegateCommand<T>

    Delegate command to interact with the binding command.

    Inheritance
    System.Object
    DelegateCommand<T>
    Implements
    System.Windows.Input.ICommand
    ISuppressCommand
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Windows.Shared.Olap
    Assembly: Syncfusion.OlapShared.WPF.dll
    Syntax
    public class DelegateCommand<T> : ICommand, ISuppressCommand
    Type Parameters
    Name
    T

    Constructors

    DelegateCommand(Action)

    Initializes a new instance of the DelegateCommand<T> class.

    Declaration
    public DelegateCommand(Action executeMethod)
    Parameters
    Type Name Description
    System.Action executeMethod

    The execute method.

    DelegateCommand(Action, Func<Boolean>)

    Initializes a new instance of the DelegateCommand<T> class.

    Declaration
    public DelegateCommand(Action executeMethod, Func<bool> CanExecute)
    Parameters
    Type Name Description
    System.Action executeMethod

    The execute method.

    System.Func<System.Boolean> CanExecute

    The can execute.

    Methods

    CanExecute()

    Determines whether this instance can execute.

    Declaration
    public bool CanExecute()
    Returns
    Type Description
    System.Boolean

    true if this instance can execute; otherwise, false.

    Remarks

    This one is a suppress implementation of CanExecute in ICommand.

    CanExecute(Object)

    Defines the method that determines whether the command can execute in its current state.

    Declaration
    public bool CanExecute(object parameter)
    Parameters
    Type Name Description
    System.Object parameter

    Data used by the command. If the command does not require data to be passed, this object can be set to null.

    Returns
    Type Description
    System.Boolean

    true if this command can be executed; otherwise, false.

    Execute()

    Executes this instance.

    Declaration
    public void Execute()
    Remarks

    This one is a suppress implementation of Execute in ICommand.

    Execute(Object)

    Defines the method to be called when the command is invoked.

    Declaration
    public void Execute(object parameter)
    Parameters
    Type Name Description
    System.Object parameter

    Data used by the command. If the command does not require data to be passed, this object can be set to null.

    Events

    CanExecuteChanged

    Occurs when changes occur that affect whether or not the command should execute.

    Declaration
    public event EventHandler CanExecuteChanged
    Event Type
    Type
    System.EventHandler

    Implements

    System.Windows.Input.ICommand
    ISuppressCommand
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved