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
|
|
@ -33,9 +33,14 @@ namespace MapControl
|
|||
MapPanel.InitMapElement(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replaces ListBoxItem pointer event handling by not calling base.OnPointerPressed.
|
||||
/// Setting e.Handled = true generates a PointerReleased event in the parent MapItemsControl,
|
||||
/// which differs from the behavior of the ListBox base class, where neither a PointerPressed
|
||||
/// nor a PointerReleased is generated.
|
||||
/// </summary>
|
||||
protected override void OnPointerPressed(PointerRoutedEventArgs e)
|
||||
{
|
||||
// Prevent default handling in ListBoxItem by not calling base.OnPointerPressed.
|
||||
if (!e.Handled)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
|
@ -44,12 +49,6 @@ namespace MapControl
|
|||
}
|
||||
}
|
||||
|
||||
protected override void OnPointerReleased(PointerRoutedEventArgs e)
|
||||
{
|
||||
// Prevent default handling in ListBoxItem by not calling base.OnPointerReleased.
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
protected override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue