Skip to content

Commit 99ab02c

Browse files
authored
Fixed a crash that would sometimes occur when right clicking an item using a touch screen (#1977)
1 parent d8f428c commit 99ab02c

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Files/Views/LayoutModes/GenericFileBrowser.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@
544544
PreparingCellForEdit="AllView_PreparingCellForEdit"
545545
PreviewKeyDown="AllView_PreviewKeyDown"
546546
RightTapped="AllView_RightTapped"
547+
Holding="AllView_Holding"
547548
RowDetailsVisibilityMode="Collapsed"
548549
ScrollViewer.IsScrollInertiaEnabled="True"
549550
SelectionChanged="AllView_SelectionChanged"

Files/Views/LayoutModes/GenericFileBrowser.xaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,16 @@ private void AllView_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
375375
}
376376

377377
public void AllView_RightTapped(object sender, RightTappedRoutedEventArgs e)
378+
{
379+
HandleRightClick(sender, e);
380+
}
381+
382+
public void AllView_Holding(object sender, HoldingRoutedEventArgs e)
383+
{
384+
HandleRightClick(sender, e);
385+
}
386+
387+
private void HandleRightClick(object sender, RoutedEventArgs e)
378388
{
379389
var rowPressed = Interacts.Interaction.FindParent<DataGridRow>(e.OriginalSource as DependencyObject);
380390
if (rowPressed != null)

0 commit comments

Comments
 (0)