2023-01-19 17:16:02 +01:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2024-02-03 21:01:53 +01:00
|
|
|
|
// Copyright © 2024 Clemens Fischer
|
2023-01-19 17:16:02 +01:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Input;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class MapItem
|
|
|
|
|
|
{
|
2024-05-23 18:08:14 +02:00
|
|
|
|
public static readonly DependencyProperty AutoCollapseProperty =
|
2024-05-24 15:14:05 +02:00
|
|
|
|
DependencyPropertyHelper.AddOwner<MapItem, bool>(MapPanel.AutoCollapseProperty);
|
2023-01-19 17:16:02 +01:00
|
|
|
|
|
2024-05-23 18:08:14 +02:00
|
|
|
|
public static readonly DependencyProperty LocationProperty =
|
2024-07-05 09:20:30 +02:00
|
|
|
|
DependencyPropertyHelper.AddOwner<MapItem, Location>(MapPanel.LocationProperty, null,
|
2024-05-23 18:08:14 +02:00
|
|
|
|
(item, oldValue, newValue) => item.UpdateMapTransform(newValue));
|
2023-01-19 17:16:02 +01:00
|
|
|
|
|
|
|
|
|
|
static MapItem()
|
|
|
|
|
|
{
|
|
|
|
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapItem), new FrameworkPropertyMetadata(typeof(MapItem)));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
|
|
|
|
|
{
|
2024-05-29 16:29:13 +02:00
|
|
|
|
(ItemsControl.ItemsControlFromItemContainer(this) as MapItemsControl)?
|
|
|
|
|
|
.OnItemClicked(this, Keyboard.Modifiers.HasFlag(ModifierKeys.Control));
|
2024-05-28 08:09:44 +02:00
|
|
|
|
|
|
|
|
|
|
e.Handled = true;
|
2023-01-19 17:16:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|