mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace MapControl
|
|
{
|
|
public partial class MapItem
|
|
{
|
|
public static readonly DependencyProperty AutoCollapseProperty =
|
|
DependencyPropertyHelper.AddOwner<MapItem, bool>(MapPanel.AutoCollapseProperty);
|
|
|
|
public static readonly DependencyProperty LocationProperty =
|
|
DependencyPropertyHelper.AddOwner<MapItem, Location>(MapPanel.LocationProperty, null,
|
|
(item, oldValue, newValue) => item.UpdateMapTransform(newValue));
|
|
|
|
static MapItem()
|
|
{
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapItem), new FrameworkPropertyMetadata(typeof(MapItem)));
|
|
}
|
|
|
|
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
|
{
|
|
if (Keyboard.Modifiers.HasFlag(ModifierKeys.Shift))
|
|
{
|
|
e.Handled = true;
|
|
MapItemsControl.SetSelectedItemsRange(this);
|
|
}
|
|
else
|
|
{
|
|
base.OnMouseLeftButtonDown(e);
|
|
}
|
|
}
|
|
}
|
|
}
|