Skip to content

Commit

Permalink
#2: Crash on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Aldaviva committed Mar 10, 2023
1 parent 78039a5 commit 5c3b7f8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#nullable enable

using System.Linq;
using System.Windows;
using System.Windows.Input;
using Dark.Net;
using RemoteDesktopServicesCertificateSelector.ViewModels;

namespace RemoteDesktopServicesCertificateSelector.Views;
namespace RemoteDesktopServicesCertificateSelector.Views;

public partial class MainWindow {

Expand All @@ -18,7 +19,10 @@ public MainWindow() {

private void onWindowLoaded(object sender, RoutedEventArgs e) {
dataGrid.Focus();
dataGrid.CurrentCell = dataGrid.SelectedCells[0];

if (dataGrid.SelectedCells.Any()) {
dataGrid.CurrentCell = dataGrid.SelectedCells[0];
}
}

private void onDataGridKeyUp(object _, KeyEventArgs args) {
Expand Down

0 comments on commit 5c3b7f8

Please sign in to comment.