Codemaru 1.0.0.0
QR 코드, 모바일 랜딩 페이지, vCard 연락처 저장과 명함 디자인을 한 화면에서 제공하는 디지털 명함 서비스입니다.
로딩중...
검색중...
일치하는것 없음
Codemaru.ViewModels.AsyncRelayCommand 클래스 참조sealed

더 자세히 ...

Codemaru.ViewModels.AsyncRelayCommand에 대한 상속 다이어그램 :
Codemaru.ViewModels.AsyncRelayCommand에 대한 협력 다이어그램:

Public 멤버 함수

 AsyncRelayCommand (Func< Task > execute, Func< bool >? canExecute=null)
bool CanExecute (object? parameter)
async void Execute (object? parameter)
void RaiseCanExecuteChanged ()

이벤트

EventHandler? CanExecuteChanged

Private 속성

readonly Func< Task > _execute
readonly? Func< bool > _canExecute
bool _isRunning

상세한 설명

비동기 ICommand 구현입니다.

AsyncRelayCommand.cs 파일의 13 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ AsyncRelayCommand()

Codemaru.ViewModels.AsyncRelayCommand.AsyncRelayCommand ( Func< Task > execute,
Func< bool >? canExecute = null )
inline

AsyncRelayCommand 클래스의 새 인스턴스를 초기화합니다.

매개변수
execute실행할 비동기 작업입니다.
canExecute실행 가능 여부를 반환하는 조건입니다.
예외
ArgumentNullException필수 입력 인자 중 하나가 null인 경우 발생합니다.

AsyncRelayCommand.cs 파일의 75 번째 라인에서 정의되었습니다.

76 {
77 _execute = execute ?? throw new ArgumentNullException(nameof(execute));
78 _canExecute = canExecute;
79 }

다음을 참조함 : _canExecute, _execute.

멤버 함수 문서화

◆ CanExecute()

bool Codemaru.ViewModels.AsyncRelayCommand.CanExecute ( object? parameter)
inline

Can Execute 조건을 확인합니다.

매개변수
parameterparameter에 사용할 object? 값입니다.
반환값
Can Execute 조건이 충족되면 true이고, 그렇지 않으면 false입니다.

AsyncRelayCommand.cs 파일의 115 번째 라인에서 정의되었습니다.

115=> !_isRunning && (_canExecute?.Invoke() ?? true);

다음을 참조함 : _canExecute, _isRunning.

다음에 의해서 참조됨 : Execute().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ Execute()

async void Codemaru.ViewModels.AsyncRelayCommand.Execute ( object? parameter)
inline

Execute 작업을 수행합니다.

매개변수
parameterparameter에 사용할 object? 값입니다.

AsyncRelayCommand.cs 파일의 133 번째 라인에서 정의되었습니다.

134 {
135 if (!CanExecute(parameter))
136 {
137 return;
138 }
139
140 try
141 {
142 _isRunning = true;
143 RaiseCanExecuteChanged();
144 await _execute();
145 }
146 catch (Exception ex)
147 {
148 System.Diagnostics.Debug.WriteLine($"[AsyncRelayCommand] {ex}");
149 }
150 finally
151 {
152 _isRunning = false;
153 RaiseCanExecuteChanged();
154 }
155 }

다음을 참조함 : _execute, _isRunning, CanExecute(), RaiseCanExecuteChanged().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ RaiseCanExecuteChanged()

void Codemaru.ViewModels.AsyncRelayCommand.RaiseCanExecuteChanged ( )
inline

CanExecuteChanged 이벤트를 UI Dispatcher에서 발생시킵니다.

AsyncRelayCommand.cs 파일의 165 번째 라인에서 정의되었습니다.

166 {
167 System.Windows.Threading.Dispatcher? dispatcher =
168 System.Windows.Application.Current?.Dispatcher;
169
170 if (dispatcher is null || dispatcher.CheckAccess())
171 {
172 CanExecuteChanged?.Invoke(this, EventArgs.Empty);
173 return;
174 }
175
176 dispatcher.InvokeAsync(() => CanExecuteChanged?.Invoke(this, EventArgs.Empty));
177 }

다음을 참조함 : CanExecuteChanged.

다음에 의해서 참조됨 : Execute().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

멤버 데이터 문서화

◆ _canExecute

readonly? Func<bool> Codemaru.ViewModels.AsyncRelayCommand._canExecute
private

can Execute 값을 보관합니다.

AsyncRelayCommand.cs 파일의 32 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AsyncRelayCommand(), CanExecute().

◆ _execute

readonly Func<Task> Codemaru.ViewModels.AsyncRelayCommand._execute
private

execute 값을 보관합니다.

AsyncRelayCommand.cs 파일의 23 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : AsyncRelayCommand(), Execute().

◆ _isRunning

bool Codemaru.ViewModels.AsyncRelayCommand._isRunning
private

is Running 값을 보관합니다.

AsyncRelayCommand.cs 파일의 41 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : CanExecute(), Execute().

이벤트 문서화

◆ CanExecuteChanged

EventHandler? Codemaru.ViewModels.AsyncRelayCommand.CanExecuteChanged

Can Execute Changed 상황이 발생할 때 알립니다.

AsyncRelayCommand.cs 파일의 89 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : RaiseCanExecuteChanged().


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: