mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
MapItemsControl ContextMenu
This commit is contained in:
parent
0bc344331c
commit
2efafcf92f
2 changed files with 10 additions and 29 deletions
|
|
@ -30,37 +30,18 @@ namespace MapControl
|
|||
|
||||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
if (ItemsControl.ItemsControlFromItemContainer(this) is MapItemsControl mapItemsControl)
|
||||
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Shift) &&
|
||||
ItemsControl.ItemsControlFromItemContainer(this) is MapItemsControl mapItemsControl &&
|
||||
mapItemsControl.SelectionMode == SelectionMode.Extended)
|
||||
{
|
||||
if (mapItemsControl.SelectionMode == SelectionMode.Extended &&
|
||||
Keyboard.Modifiers.HasFlag(ModifierKeys.Shift))
|
||||
{
|
||||
mapItemsControl.SelectItemsInRange(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Perform default mouse down item selection on mouse up.
|
||||
//
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
}
|
||||
mapItemsControl.SelectItemsInRange(this);
|
||||
e.Handled = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
OnMouseLeftButtonUp(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue