2012-01-21 4 views
0

저는 mvvm 패턴을 사용하여 첫 wpf 프로젝트를 가지고 놀고 있습니다. WPF 용 Microsoft 리본이있어서 MainWindowViewModel에서 메서드를 시작하지 못합니다. http://msdn.microsoft.com/en-us/magazine/dd419663.aspxBinding RibbonButton

MainWindow.xaml

<ribbon:RibbonButton x:Name="Button1" LargeImageSource="Images\home32.png" Label="Opret klub" Command="{Binding Path=CreateNewClub1}" /> 

MainWindowViewModel

public RelayCommand CreateNewClub1() 
    { 
     return new RelayCommand(param => this.CreateNewClub()); 
    } 

나는 (이 메소드 CreateNewClub1 해고 얻을 수를 : 여기에 설명 된대로 나는 수행하기 위해 노력하고있어). 나는 무엇을 놓치고 있습니까?

+0

당신이 (Visual Studio에서 출력 서브 윈도우에서) 어떤 바인딩 오류를 받고 있습니까? –

답변

1

CreateNewClub1하지 방법, 속성이어야합니다

public RelayCommand CreateNewClub1 
{ 
    get 
    { 
     return new RelayCommand(param => this.CreateNewClub()); 
    } 
} 
+0

고마워, 그게 해결 됐어. – Frets