private void Window_Loaded(object sender, RoutedEventArgs e) { MainDataGrid.Focus(); if (!string.IsNullOrEmpty(kPw.Settings.PreviouslyLoadedFile) && File.Exists(kPw.Settings.PreviouslyLoadedFile)) { ShowPasswordPanel(kPw.CurrentOperation = EncryptDecryptOperation.Decrypt, kPwFile.TmpPath = kPw.Settings.PreviouslyLoadedFile); } }
private void Dialog_Loaded(object sender, RoutedEventArgs e) { var remove = AlbumList?.FirstOrDefault(f => string.IsNullOrWhiteSpace(f.Id) || f.Id == "♥♦♣♠"); if (remove != null) { AlbumList.Remove(remove); } MainDataGrid.ItemsSource = AlbumList; MainDataGrid.Focus(); if (MainDataGrid.Items.Count > 0) { MainDataGrid.SelectedIndex = 0; MainDataGrid.FocusOnFirstCell(); } }