Dreamine.MVVM.Attributes 1.0.7
Dreamine.MVVM.Attributes 프로젝트의 API와 구성 요소를 제공합니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.MVVM.Attributes.DreamineCommandAttribute 클래스 참조sealed

메서드를 커맨드 생성 대상으로 표시하는 특성입니다. 더 자세히 ...

Dreamine.MVVM.Attributes.DreamineCommandAttribute에 대한 상속 다이어그램 :
Dreamine.MVVM.Attributes.DreamineCommandAttribute에 대한 협력 다이어그램:

Public 멤버 함수

 DreamineCommandAttribute ()
 DreamineCommandAttribute 클래스의 새 인스턴스를 초기화합니다.
 DreamineCommandAttribute (string targetMethod)
 DreamineCommandAttribute 클래스의 새 인스턴스를 초기화합니다.

속성

string? TargetMethod [get]
 호출할 대상 메서드 경로를 가져옵니다.
string? BindTo [get, set]
 대상 메서드의 반환값을 자동 대입할 프로퍼티 이름을 가져오거나 설정합니다.
string? CommandName [get, set]
 생성될 커맨드 프로퍼티 이름을 가져오거나 설정합니다.
string? CanExecute [get, set]
 실행 가능 여부를 판단하는 메서드 이름을 가져오거나 설정합니다.

상세한 설명

메서드를 커맨드 생성 대상으로 표시하는 특성입니다.

대상 메서드가 지정되지 않으면 이 특성이 적용된 메서드를 직접 실행하는 커맨드를 생성합니다. 대상 메서드가 지정되면 TargetMethod를 호출하는 forwarding command를 생성하며, 필요 시 반환값을 BindTo에 지정한 프로퍼티에 자동 대입합니다.

예: Event.ReadmeClick, Service.Load, Foo

이 특성은 소스 생성기와 함께 사용되며, 대상 메서드를 선언한 ViewModel 메서드는 partial 메서드로 유지하는 것을 권장합니다.

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

생성자 & 소멸자 문서화

◆ DreamineCommandAttribute() [1/2]

Dreamine.MVVM.Attributes.DreamineCommandAttribute.DreamineCommandAttribute ( )
inline

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

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

117 {
118 }

◆ DreamineCommandAttribute() [2/2]

Dreamine.MVVM.Attributes.DreamineCommandAttribute.DreamineCommandAttribute ( string targetMethod)
inline

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

매개변수
targetMethod호출할 대상 메서드 경로입니다.
예외
ArgumentNullExceptiontargetMethodnull인 경우 발생합니다.

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

145 {
146 TargetMethod = targetMethod ?? throw new ArgumentNullException(nameof(targetMethod));
147 }

다음을 참조함 : TargetMethod.

속성 문서화

◆ BindTo

string? Dreamine.MVVM.Attributes.DreamineCommandAttribute.BindTo
getset

대상 메서드의 반환값을 자동 대입할 프로퍼티 이름을 가져오거나 설정합니다.

이 값이 지정되면 생성된 커맨드는 대상 메서드의 반환값을 해당 프로퍼티에 대입합니다.

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

64{ get; set; }

◆ CanExecute

string? Dreamine.MVVM.Attributes.DreamineCommandAttribute.CanExecute
getset

실행 가능 여부를 판단하는 메서드 이름을 가져오거나 설정합니다.

지정하면 생성된 커맨드의 CanExecute가 해당 메서드를 호출합니다. 반드시 bool 반환형이며 매개변수 없는 메서드여야 합니다. 예: [DreamineCommand(CanExecute = nameof(CanSave))] 지정하지 않으면 항상 true를 반환합니다.

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

106{ get; set; }

◆ CommandName

string? Dreamine.MVVM.Attributes.DreamineCommandAttribute.CommandName
getset

생성될 커맨드 프로퍼티 이름을 가져오거나 설정합니다.

지정하지 않으면 기본적으로 "{메서드명}Command" 형식이 사용됩니다.

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

82{ get; set; }

◆ TargetMethod

string? Dreamine.MVVM.Attributes.DreamineCommandAttribute.TargetMethod
get

호출할 대상 메서드 경로를 가져옵니다.

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

46{ get; }

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


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