I have the following in my ViewModel:
public MyViewModel() {
CloseCommend = new RelayCommand(closeWindow);
}
public RelayCommand CloseCommend;
private void closeWindow() {
Application.Current.MainWindow.Close();
}
XAML:
<Button ... Command="{Binding CloseCommend}"/>
I see the ViewModel constructor is initialized so the binding should be there. But when I click the close button, nothing happens. Any ideas what I'm doing wrong?