Skip to content

Commit

Permalink
added empty selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkadySK committed Jun 22, 2022
1 parent 51a6160 commit 5a5c42c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion GbxMapBrowser/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<RowDefinition />
<RowDefinition Height="30"/>
</Grid.RowDefinitions>
<ListBox x:Name="mapListBox" HorizontalContentAlignment="Stretch" Grid.Column="1" ScrollViewer.CanContentScroll="False"
<ListBox x:Name="mapListBox" HorizontalContentAlignment="Stretch" Grid.Column="1" ScrollViewer.CanContentScroll="False" Padding="5"
MouseDoubleClick="mapListBox_MouseDoubleClickAsync" AllowDrop="True" Drop="mapListBox_Drop" SelectionChanged="mapListBox_SelectionChanged"
PreviewMouseDown="mapListBox_PreviewMouseDown" KeyDown="mapListBox_KeyDown" SelectionMode="Extended" ContextMenuOpening="mapListBox_ContextMenuOpening">
<ListBox.Resources>
Expand Down
4 changes: 3 additions & 1 deletion GbxMapBrowser/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,9 @@ void ShowContextMenu()

private void mapListBox_ContextMenuOpening(object sender, ContextMenuEventArgs e)
{
UpdateContextMenu();
if (e.OriginalSource is ScrollViewer)
mapListBox.SelectedItem = null;
UpdateContextMenu();
((ListBox)sender).ContextMenu.PreviewMouseUp += ItemContextMenu_PreviewMouseUp;
}

Expand Down

0 comments on commit 5a5c42c

Please sign in to comment.