menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class DelegateCommand - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class DelegateCommand

    Represents a command that can perform a given action.

    Inheritance
    System.Object
    DelegateCommand<System.Object>
    DelegateCommand
    Implements
    System.Windows.Input.ICommand
    Inherited Members
    DelegateCommand<Object>.CanExecute(Object)
    DelegateCommand<Object>.CanExecuteChanged
    DelegateCommand<Object>.Execute(Object)
    DelegateCommand<Object>.RaiseCanExecuteChanged()
    Namespace: Syncfusion.UI.Xaml.Core
    Assembly: Syncfusion.Core.WinUI.dll
    Syntax
    public class DelegateCommand : DelegateCommand<object>, ICommand

    Constructors

    DelegateCommand(Action<Object>)

    Initializes a new instance of the DelegateCommand class.

    Declaration
    public DelegateCommand(Action<object> method)
    Parameters
    Type Name Description
    System.Action<System.Object> method

    The method.

    DelegateCommand(Action<Object>, Predicate<Object>)

    Initializes a new instance of the DelegateCommand class.

    Declaration
    public DelegateCommand(Action<object> action, Predicate<object> canExecute)
    Parameters
    Type Name Description
    System.Action<System.Object> action

    The action to execute when called.

    System.Predicate<System.Object> canExecute

    The function to call to determine if the command can execute the action.

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if the execute action is null.

    Implements

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