다음을 통해 공유


Command<T> 생성자

정의

오버로드

Command<T>(Action<T>)

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

Command<T>(Action<T>, Func<T,Boolean>)

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

Command<T>(Action<T>)

Source:
Command.cs
Source:
Command.cs

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

public:
 Command(Action<T> ^ execute);
public Command (Action<T> execute);
new Microsoft.Maui.Controls.Command<'T> : Action<'T> -> Microsoft.Maui.Controls.Command<'T>
Public Sub New (execute As Action(Of T))

매개 변수

execute
Action<T>

명령이 실행될 때 실행할 동작입니다.

적용 대상

Command<T>(Action<T>, Func<T,Boolean>)

Source:
Command.cs
Source:
Command.cs

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

public:
 Command(Action<T> ^ execute, Func<T, bool> ^ canExecute);
public Command (Action<T> execute, Func<T,bool> canExecute);
new Microsoft.Maui.Controls.Command<'T> : Action<'T> * Func<'T, bool> -> Microsoft.Maui.Controls.Command<'T>
Public Sub New (execute As Action(Of T), canExecute As Func(Of T, Boolean))

매개 변수

execute
Action<T>

명령이 실행될 때 실행할 작업<개체>입니다.

canExecute
Func<T,Boolean>

명령을 실행할 수 있는지 여부를 나타내는 Func<T,TResult>입니다.

설명

canExecute에서 반환된 값이 변경되면 를 트리거CanExecuteChanged하려면 에 대한 ChangeCanExecute() 호출이 필요합니다.

적용 대상