Dreamine.Communication.Wpf
1.0.2
Dreamine.Communication.Wpf 통신 기능과 관련 API를 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
DelegateCommand.cs
이 파일의 문서화 페이지로 가기
1
using
System;
2
using
System.Windows.Input;
3
4
namespace
Dreamine.Communication.Wpf.Commands
;
5
14
public
sealed
class
DelegateCommand
: ICommand
15
{
24
private
readonly Action<object?>
_execute
;
33
private
readonly Predicate<object?>?
_canExecute
;
34
67
public
DelegateCommand
(Action<object?> execute, Predicate<object?>? canExecute =
null
)
68
{
69
_execute
= execute ??
throw
new
ArgumentNullException(nameof(execute));
70
_canExecute
= canExecute;
71
}
72
81
public
event
EventHandler?
CanExecuteChanged
;
82
107
public
bool
CanExecute
(
object
? parameter)
108
{
109
return
_canExecute
?.Invoke(parameter) ??
true
;
110
}
111
128
public
void
Execute
(
object
? parameter)
129
{
130
_execute
(parameter);
131
}
132
141
public
void
RaiseCanExecuteChanged
()
142
{
143
CanExecuteChanged
?.Invoke(
this
, EventArgs.Empty);
144
}
145
}
Dreamine.Communication.Wpf.Commands
Definition
DelegateCommand.cs:4
Dreamine.Communication.Wpf.Commands.DelegateCommand.Execute
void Execute(object? parameter)
Definition
DelegateCommand.cs:128
Dreamine.Communication.Wpf.Commands.DelegateCommand.DelegateCommand
DelegateCommand(Action< object?> execute, Predicate< object?>? canExecute=null)
Definition
DelegateCommand.cs:67
Dreamine.Communication.Wpf.Commands.DelegateCommand._canExecute
readonly? Predicate< object?> _canExecute
Definition
DelegateCommand.cs:33
Dreamine.Communication.Wpf.Commands.DelegateCommand._execute
readonly Action< object?> _execute
Definition
DelegateCommand.cs:24
Dreamine.Communication.Wpf.Commands.DelegateCommand.RaiseCanExecuteChanged
void RaiseCanExecuteChanged()
Definition
DelegateCommand.cs:141
Dreamine.Communication.Wpf.Commands.DelegateCommand.CanExecute
bool CanExecute(object? parameter)
Definition
DelegateCommand.cs:107
Dreamine.Communication.Wpf.Commands.DelegateCommand.CanExecuteChanged
EventHandler? CanExecuteChanged
Definition
DelegateCommand.cs:81
Commands
DelegateCommand.cs
다음에 의해 생성됨 :
1.17.0