I'm using Catel as my MVVM framework to develop a WPF application.
I open my window via the UIVisualizerService, provided by Catel, like this:
this.uiVisualizerService.ShowDialog(new ViewModel);
This works perfectly. The problem is that I can't close my window with, like said on the Catel website
this.CloseViewModel(true);
When I click the cancel button, the command is executed, but nothing happens.
More info:
My window code-behind class:
public partial class Window : Window
{
public Window()
{
this.InitializeComponent();
}
}
My Cancel button:
<Button Command="{Binding CancelCommand}" />
My command method in my viewmodel:
private void CancelCommandExecuted()
{
this.CloseViewModel(true);
}
Thanks in advance!