Skip to content

Commit 518e892

Browse files
committed
Fix Potential Crash During Row Cut Mode Reset
1 parent 6bf58ed commit 518e892

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Files UWP/Filesystem/ItemViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public async void AddItemsToCollectionAsync(string path, Page currentPage)
232232
TextState.isVisible = Visibility.Visible;
233233
}
234234
stopwatch.Stop();
235-
Debug.WriteLine("Loading of items in " + Universal.path + " completed in " + stopwatch.Elapsed.Milliseconds + " milliseconds.\n");
235+
Debug.WriteLine("Loading of items in " + Universal.path + " completed in " + stopwatch.ElapsedMilliseconds + " milliseconds.\n");
236236

237237
}
238238
catch (UnauthorizedAccessException e)

Files UWP/GenericFileBrowser.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
141141
}
142142

143143
// Reset DataGrid Rows that may be in "cut" command mode
144+
Interaction.dataGridRows.Clear();
144145
Interaction.FindChildren<DataGridRow>(Interaction.dataGridRows, GenericFileBrowser.GFBPageName.Content);
145146
foreach (DataGridRow dataGridRow in Interaction.dataGridRows)
146147
{

Files UWP/YourHome.xaml.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
4848
ProHome.RS.isEnabled = false;
4949
ProHome.accessiblePasteButton.IsEnabled = false;
5050
App.AlwaysPresentCommands.isEnabled = false;
51+
App.LayoutItems.isEnabled = false;
5152
}
5253

5354
private void CardPressed(object sender, ItemClickEventArgs e)
@@ -59,34 +60,40 @@ private void CardPressed(object sender, ItemClickEventArgs e)
5960
ProHome.locationsList.SelectedIndex = 2;
6061
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
6162
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), DownloadsPath);
63+
App.LayoutItems.isEnabled = true;
6264
}
6365
else if (BelowCardText == "Documents")
6466
{
6567

6668
ProHome.locationsList.SelectedIndex = 3;
6769
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
6870
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), DocumentsPath);
71+
App.LayoutItems.isEnabled = true;
6972
}
7073
else if (BelowCardText == "Pictures")
7174
{
7275

7376
ProHome.locationsList.SelectedIndex = 4;
7477
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
7578
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), PicturesPath);
79+
App.LayoutItems.isEnabled = true;
80+
7681
}
7782
else if (BelowCardText == "Music")
7883
{
7984

8085
ProHome.locationsList.SelectedIndex = 5;
8186
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
8287
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MusicPath);
88+
App.LayoutItems.isEnabled = true;
8389
}
8490
else if (BelowCardText == "Videos")
8591
{
8692

8793
ProHome.locationsList.SelectedIndex = 6;
8894
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
8995
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), VideosPath);
96+
App.LayoutItems.isEnabled = true;
9097
}
9198
}
9299

@@ -109,34 +116,39 @@ private void Button_Tapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEven
109116
ProHome.locationsList.SelectedIndex = 2;
110117
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
111118
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), DownloadsPath);
119+
App.LayoutItems.isEnabled = true;
112120
}
113121
else if (clickedButton.Tag.ToString() == "\xE8A5") // Documents
114122
{
115123

116124
ProHome.locationsList.SelectedIndex = 3;
117125
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
118126
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), DocumentsPath);
127+
App.LayoutItems.isEnabled = true;
119128
}
120129
else if (clickedButton.Tag.ToString() == "\xEB9F") // Pictures
121130
{
122131

123132
ProHome.locationsList.SelectedIndex = 4;
124133
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
125134
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), PicturesPath);
135+
App.LayoutItems.isEnabled = true;
126136
}
127137
else if (clickedButton.Tag.ToString() == "\xEC4F") // Music
128138
{
129139

130140
ProHome.locationsList.SelectedIndex = 5;
131141
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
132142
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MusicPath);
143+
App.LayoutItems.isEnabled = true;
133144
}
134145
else if (clickedButton.Tag.ToString() == "\xE8B2") // Videos
135146
{
136147

137148
ProHome.locationsList.SelectedIndex = 6;
138149
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
139150
ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), VideosPath);
151+
App.LayoutItems.isEnabled = true;
140152
}
141153
}
142154
public static StorageFile RecentsFile;

0 commit comments

Comments
 (0)