0

I have tried for 2 days how to open a new window in WPF MVVM.

I have read a lot of articles and questions on stackoverflow. In this question WPF MVVM - How to Show a view from MainWindowViewModel upon Clicking on button there was an answer where mak gave 4 examples, and any of it doesn't want to work :(

for example I have this code:

private void Button_Click(object sender, RoutedEventArgs e)
    {
        Ranking view = new Ranking();
        view.Show();
    }

where Ranking is a view and I get an error like missing assembly reference and no extension method 'Show' accepting a first agrument. In mediator pattern I've got also error like:

The name 'Messenger' does not exist in the current context
and The type or namespace name 'AddCustomerMessage' could not be found (are you missing a using directive or an assembly reference?)

Please help I don't have any ideas how to fix it or if somebody have an example project to download please share it.

Thanks a lot!

Community
  • 1
  • 1
Icet
  • 678
  • 2
  • 13
  • 31

0 Answers0