diff options
author | Eric Maupin <ermaup@microsoft.com> | 2018-06-12 19:28:44 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2018-06-12 19:43:00 +0300 |
commit | 8664af58e80edf6183a30021d87bcb4a799ce7dc (patch) | |
tree | 42e78fb426e3e944e540c862b5f030bbf14585a1 /Xamarin.PropertyEditing.Windows | |
parent | 677a401a73e1120dc26b5e7a78d3aee4128584f4 (diff) |
[Win] Fix double click on scrollbar selecting
Diffstat (limited to 'Xamarin.PropertyEditing.Windows')
-rw-r--r-- | Xamarin.PropertyEditing.Windows/ResourceSelectorWindow.xaml.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Xamarin.PropertyEditing.Windows/ResourceSelectorWindow.xaml.cs b/Xamarin.PropertyEditing.Windows/ResourceSelectorWindow.xaml.cs index 7744761..f1775b8 100644 --- a/Xamarin.PropertyEditing.Windows/ResourceSelectorWindow.xaml.cs +++ b/Xamarin.PropertyEditing.Windows/ResourceSelectorWindow.xaml.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Windows; +using System.Windows.Controls; using System.Windows.Input; +using System.Windows.Media; using Xamarin.PropertyEditing.ViewModels; namespace Xamarin.PropertyEditing.Windows @@ -50,7 +52,18 @@ namespace Xamarin.PropertyEditing.Windows if (this.list.SelectedItem == null) return; - DialogResult = true; + Point pos = e.GetPosition (this.list); + var element = this.list.InputHitTest (pos) as DependencyObject; + while (element != null) { + if (element is ListBoxItem) { + DialogResult = true; + return; + } + if (element is ListBox) + return; + + element = VisualTreeHelper.GetParent (element); + } } } } |