mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-25 21:07:20 -08:00
enhance: do NOT trigger double clicking events when user click the blank area of ListBox
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
a5606e80d4
commit
4835c3f1e9
1 changed files with 5 additions and 2 deletions
|
@ -730,9 +730,12 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
private void OnCommitListDoubleTapped(object sender, TappedEventArgs e)
|
private void OnCommitListDoubleTapped(object sender, TappedEventArgs e)
|
||||||
{
|
{
|
||||||
if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: 1 } selected })
|
if (DataContext is ViewModels.Histories histories && sender is ListBox { SelectedItems: { Count: 1 } } listBox)
|
||||||
{
|
{
|
||||||
histories.DoubleTapped(selected[0] as Models.Commit);
|
var source = e.Source as Control;
|
||||||
|
var item = source.FindAncestorOfType<ListBoxItem>();
|
||||||
|
if (item is { DataContext: Models.Commit commit })
|
||||||
|
histories.DoubleTapped(commit);
|
||||||
}
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue