public RegistrationWindow(MainWindow mainWindow)
 {
     InitializeComponent();
     _mainWindow = mainWindow;
     _mainWindow.Hide();
     DataContext = new UserRegistrationViewModel(this);
 }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            UserRegistrationViewModel registrationViewModel = DataContext as UserRegistrationViewModel;

            if (registrationViewModel.UserRegistration.isUpdating)
            {
                registrationViewModel.SendEmailAboutUpdate();
            }
            _mainWindow.Show();
        }