private void OpenAddUserWindow(UserDto newUser) { AddUserWindow window = new AddUserWindow(); window.Owner = this; AddUserWindowViewModel viewModel = (AddUserWindowViewModel)window.DataContext; viewModel.User = newUser; window.ShowDialog(); }
public AddUserWindowView() { InitializeComponent(); AddUserWindowViewModel viewModel = new AddUserWindowViewModel(); DataContext = viewModel; Closing += viewModel.OnWindowClosing; Messenger.Default.Register <NotificationMessage>(this, m => { if (m.Notification == "Close") { this.Close(); } }); }