2010-12-31 6 views

답변

5

당신은 버튼 컨트롤에 대한 예 Caliburn.Micro가보기를 전달합니다 (Screen 유형의 일부), 뷰 모델 AttachView 또는 OnViewLoaded을 재정의 할 수

public override void AttachView(object view, object context) 
{ 
    base.AttachView(view, context); 

    var frameworkElement = view as FrameworkElement; 

    if (frameworkElement == null) 
    { 
    return; 
    } 

    var button = frameworkElement.FindName("myButton") as Button; 

    if (button == null) 
    { 
    return; 
    } 

    // access button control here 
} 
0

당신의 getView()를 호출 뷰 모델로부터도. 그런 다음 컨트롤을 검색하거나 이름으로 액세스하십시오.

관련 문제