public LoginDatabaseDialog(LoginDataBaseViewModel vm) { this.DataContext = vm; InitializeComponent(); }
public string ShowInputPasswordDialog(ConfigurationDatabase database,string needestLogin) { LoginDataBaseViewModel viewModel = new LoginDataBaseViewModel(); viewModel.Login = needestLogin; viewModel.Database = database; LoginDatabaseDialog dialog = new LoginDatabaseDialog(viewModel); Nullable<Boolean> result = dialog.ShowDialog(); if (result.HasValue && result.Value == true) { return viewModel.Password; } return null; }