mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
MapItem mouse/pointer event handling
This commit is contained in:
parent
417d4c8987
commit
fc242ee7a4
3 changed files with 27 additions and 11 deletions
|
|
@ -18,9 +18,13 @@ namespace MapControl
|
|||
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapItem), new FrameworkPropertyMetadata(typeof(MapItem)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces ListBoxItem mouse event handling by not calling base.OnMouseLeftButtonDown.
|
||||
/// Setting e.Handled = true generates a MouseLeftButtonUp event in the parent MapItemsControl,
|
||||
/// which resembles the behavior of the ListBox base class.
|
||||
/// </summary>
|
||||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
// Prevent default handling in ListBoxItem by not calling base.OnMouseLeftButtonDown.
|
||||
if (!e.Handled)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
|
@ -29,9 +33,13 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces ListBoxItem mouse event handling by not calling base.OnMouseRightButtonDown.
|
||||
/// Setting e.Handled = true generates a MouseRightButtonUp event in the parent MapItemsControl,
|
||||
/// which resembles the behavior of the ListBox base class.
|
||||
/// </summary>
|
||||
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
// Prevent default handling in ListBoxItem by not calling base.OnMouseRightButtonDown.
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue