Dreamine.PLC.Wpf
1.0.1
Dreamine.PLC.Wpf 산업 자동화 및 I/O 기능을 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
DelegateCommand.cs
이 파일의 문서화 페이지로 가기
1
using
System.Windows.Input;
2
3
namespace
Dreamine.PLC.Wpf.Commands
;
4
13
public
sealed
class
DelegateCommand
: ICommand
14
{
23
private
readonly Action<object?>
_execute
;
32
private
readonly Predicate<object?>?
_canExecute
;
33
66
public
DelegateCommand
(Action<object?> execute, Predicate<object?>? canExecute =
null
)
67
{
68
_execute
= execute ??
throw
new
ArgumentNullException(nameof(execute));
69
_canExecute
= canExecute;
70
}
71
80
public
event
EventHandler?
CanExecuteChanged
;
81
106
public
bool
CanExecute
(
object
? parameter)
107
{
108
return
_canExecute
?.Invoke(parameter) ??
true
;
109
}
110
127
public
void
Execute
(
object
? parameter)
128
{
129
if
(
CanExecute
(parameter))
130
{
131
_execute
(parameter);
132
}
133
}
134
143
public
void
RaiseCanExecuteChanged
()
144
{
145
CanExecuteChanged
?.Invoke(
this
, EventArgs.Empty);
146
}
147
}
Dreamine.PLC.Wpf.Commands
Definition
DelegateCommand.cs:3
Dreamine.PLC.Wpf.Commands.DelegateCommand.DelegateCommand
DelegateCommand(Action< object?> execute, Predicate< object?>? canExecute=null)
Definition
DelegateCommand.cs:66
Dreamine.PLC.Wpf.Commands.DelegateCommand.CanExecuteChanged
EventHandler? CanExecuteChanged
Definition
DelegateCommand.cs:80
Dreamine.PLC.Wpf.Commands.DelegateCommand.RaiseCanExecuteChanged
void RaiseCanExecuteChanged()
Definition
DelegateCommand.cs:143
Dreamine.PLC.Wpf.Commands.DelegateCommand.CanExecute
bool CanExecute(object? parameter)
Definition
DelegateCommand.cs:106
Dreamine.PLC.Wpf.Commands.DelegateCommand.Execute
void Execute(object? parameter)
Definition
DelegateCommand.cs:127
Dreamine.PLC.Wpf.Commands.DelegateCommand._execute
readonly Action< object?> _execute
Definition
DelegateCommand.cs:23
Dreamine.PLC.Wpf.Commands.DelegateCommand._canExecute
readonly? Predicate< object?> _canExecute
Definition
DelegateCommand.cs:32
Commands
DelegateCommand.cs
다음에 의해 생성됨 :
1.17.0