fix unexpected hovor without mouse moving (#2368)

fix #975 
close #2043
This commit is contained in:
KallistiMan
2019-02-22 20:36:21 +01:00
committed by jhdxr
parent a6e82475a3
commit 1ab636a4f1
2 changed files with 28 additions and 4 deletions

View File

@@ -16,7 +16,8 @@
KeyboardNavigation.DirectionalNavigation="Cycle" SelectionMode="Single"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"
SelectionChanged="OnSelectionChanged"
IsSynchronizedWithCurrentItem="True">
IsSynchronizedWithCurrentItem="True"
PreviewMouseDown="ListBox_PreviewMouseDown">
<!--IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083-->
<ListBox.ItemTemplate>
<DataTemplate>
@@ -65,6 +66,7 @@
<ListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}">
<EventSetter Event="MouseEnter" Handler="OnMouseEnter" />
<EventSetter Event="MouseMove" Handler="OnMouseMove" />
<Setter Property="Height" Value="50" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="0" />
@@ -96,4 +98,4 @@
</Setter>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</ListBox>