Skip to content

Commit

Permalink
cancel edit cell if exit unity, fixes #176
Browse files Browse the repository at this point in the history
  • Loading branch information
unitycoder committed Nov 24, 2024
1 parent 6e64cc2 commit 8c7d355
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions UnityLauncherPro/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2931,6 +2931,13 @@ public void ProcessExitedCallBack(Project proj)
//Console.WriteLine("Process Exited: " + proj.Path);
//var index = projectsSource.IndexOf(proj); // this fails since proj has changed after refresh (timestamp or other data)

// if currently editing field, cancel it (otherwise crash)
IEditableCollectionView itemsView = gridRecent.Items;
if (itemsView.IsAddingNew || itemsView.IsEditingItem)
{
gridRecent.CancelEdit(DataGridEditingUnit.Cell);
}

// FIXME nobody likes extra loops.. but only 40 items to find correct project? but still..
for (int i = 0, len = projectsSource.Count; i < len; i++)
{
Expand Down

0 comments on commit 8c7d355

Please sign in to comment.