My MVVM program is running with App.xaml.cs
Here I create the main window. It has a frame. Here I inserted LoginView.
It has a login button. I have a command that checks and logs in.
I have this code in LoginViewModel. If everything is fine, I must show the following view. How can i do this?
App.xaml.cs
private void OnStartup(object sender, StartupEventArgs e)
{
LoginViewModel loginVM = new LoginViewModel();
MainView mainView = new MainView();
LoginView loginView = new LoginView();
loginView.DataContext = loginVM;
mainView.Frame.Content = loginView;
mainView.Show();
}
LoginViewModel.cs
private void Login()
{
if (LoginModel.Login("User1", "Password"))
{
}
}
How and where should I show all the necessary submissions? I am using the WPF MVVM Toolkit.
source
share