Drahcir
Drahcir

Reputation: 11972

How to communicate with frame page.xaml

How can I get Login.xaml to communicate with the code in MainWindow.xaml.cs so that it can change the frame once a user logs in?

Upvotes: 2

Views: 320

Answers (1)

Karel Frajták
Karel Frajták

Reputation: 4489

Communicate through view models using events. Or look for some event aggregator to eliminate coupling between the view models.

MainWindowViewModel will instantiate LoginViewModel, display the Login control and register an event OnLoggedIn and on successful login it will switch to another frame/screen.

Upvotes: 1

Related Questions