C# Class Huaban.UWP.Commands.DelegateCommand

Inheritance: ICommand
Datei anzeigen Open project: dblleaf/Huaban

Public Methods

Method Description
CanExecute ( object parameter ) : bool

决定当前绑定的Command能否被执行 true:可以被执行 false:不能被执行

DelegateCommand ( Action execute, bool>.Func canExecute ) : System

构造函数,用于初始化

Execute ( object parameter ) : void

用于执行对应的命令,只有在CanExecute可以返回true的情况下才可以被执行

RaiseCanExecuteChanged ( ) : void

需要手动触发属性改变事件

Method Details

CanExecute() public method

决定当前绑定的Command能否被执行 true:可以被执行 false:不能被执行
public CanExecute ( object parameter ) : bool
parameter object 不是必须的,可以依据情况来决定,或者重写一个对应的无参函数
return bool

DelegateCommand() public method

构造函数,用于初始化
public DelegateCommand ( Action execute, bool>.Func canExecute ) : System
execute Action
canExecute bool>.Func
return System

Execute() public method

用于执行对应的命令,只有在CanExecute可以返回true的情况下才可以被执行
public Execute ( object parameter ) : void
parameter object
return void

RaiseCanExecuteChanged() public method

需要手动触发属性改变事件
public RaiseCanExecuteChanged ( ) : void
return void