2017-06-25 23:05:48 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2018-02-09 17:43:47 +01:00
|
|
|
|
// © 2018 Clemens Fischer
|
2012-11-23 16:16:09 +01:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class MapPanel
|
|
|
|
|
|
{
|
2013-04-12 19:59:16 +02:00
|
|
|
|
private static readonly DependencyPropertyKey ParentMapPropertyKey = DependencyProperty.RegisterAttachedReadOnly(
|
2018-02-09 17:43:47 +01:00
|
|
|
|
"ParentMap", typeof(MapBase), typeof(MapPanel), new FrameworkPropertyMetadata(
|
|
|
|
|
|
null, FrameworkPropertyMetadataOptions.Inherits, ParentMapPropertyChanged));
|
2012-11-23 16:16:09 +01:00
|
|
|
|
|
2013-04-12 19:59:16 +02:00
|
|
|
|
public static readonly DependencyProperty ParentMapProperty = ParentMapPropertyKey.DependencyProperty;
|
|
|
|
|
|
|
2017-09-05 20:57:17 +02:00
|
|
|
|
public static MapBase GetParentMap(UIElement element)
|
2012-11-23 16:16:09 +01:00
|
|
|
|
{
|
2017-09-05 20:57:17 +02:00
|
|
|
|
return (MapBase)element.GetValue(ParentMapProperty);
|
2012-11-23 16:16:09 +01:00
|
|
|
|
}
|
2013-04-12 19:59:16 +02:00
|
|
|
|
|
2017-09-05 20:57:17 +02:00
|
|
|
|
public static void InitMapElement(FrameworkElement element)
|
2013-04-12 19:59:16 +02:00
|
|
|
|
{
|
2017-09-05 20:57:17 +02:00
|
|
|
|
if (element is MapBase)
|
|
|
|
|
|
{
|
|
|
|
|
|
element.SetValue(ParentMapPropertyKey, element);
|
|
|
|
|
|
}
|
2013-04-12 19:59:16 +02:00
|
|
|
|
}
|
2012-11-23 16:16:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|