2025-02-27 18:46:32 +01:00
|
|
|
|
#if UWP
|
2021-01-17 21:39:42 +01:00
|
|
|
|
using Windows.UI.Xaml;
|
2024-05-26 21:25:36 +02:00
|
|
|
|
using Windows.UI.Xaml.Data;
|
2024-05-22 11:25:32 +02:00
|
|
|
|
#else
|
|
|
|
|
|
using Microsoft.UI.Xaml;
|
2024-05-26 21:25:36 +02:00
|
|
|
|
using Microsoft.UI.Xaml.Data;
|
2021-06-14 21:41:37 +02:00
|
|
|
|
#endif
|
2021-01-17 21:39:42 +01:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
2026-02-02 14:52:58 +01:00
|
|
|
|
public partial class MapContentControl
|
2021-01-17 21:39:42 +01:00
|
|
|
|
{
|
|
|
|
|
|
public MapContentControl()
|
|
|
|
|
|
{
|
|
|
|
|
|
DefaultStyleKey = typeof(MapContentControl);
|
|
|
|
|
|
MapPanel.InitMapElement(this);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override void OnApplyTemplate()
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnApplyTemplate();
|
|
|
|
|
|
|
2021-01-17 23:39:20 +01:00
|
|
|
|
var parentMap = MapPanel.GetParentMap(this);
|
2021-01-17 21:39:42 +01:00
|
|
|
|
|
2021-01-17 23:39:20 +01:00
|
|
|
|
if (parentMap != null)
|
2021-01-17 21:39:42 +01:00
|
|
|
|
{
|
2024-05-25 15:55:31 +02:00
|
|
|
|
// Workaround for missing RelativeSource AncestorType=MapBase Bindings in default Style.
|
|
|
|
|
|
//
|
2024-05-24 18:24:44 +02:00
|
|
|
|
if (Background == null)
|
|
|
|
|
|
{
|
2024-05-26 21:25:36 +02:00
|
|
|
|
SetBinding(BackgroundProperty,
|
|
|
|
|
|
new Binding { Source = parentMap, Path = new PropertyPath(nameof(Background)) });
|
2024-05-24 18:24:44 +02:00
|
|
|
|
}
|
|
|
|
|
|
if (Foreground == null)
|
|
|
|
|
|
{
|
2024-05-26 21:25:36 +02:00
|
|
|
|
SetBinding(ForegroundProperty,
|
|
|
|
|
|
new Binding { Source = parentMap, Path = new PropertyPath(nameof(Foreground)) });
|
2024-05-24 18:24:44 +02:00
|
|
|
|
}
|
|
|
|
|
|
if (BorderBrush == null)
|
|
|
|
|
|
{
|
2024-05-26 21:25:36 +02:00
|
|
|
|
SetBinding(BorderBrushProperty,
|
|
|
|
|
|
new Binding { Source = parentMap, Path = new PropertyPath(nameof(Foreground)) });
|
2024-05-24 18:24:44 +02:00
|
|
|
|
}
|
2021-01-17 21:39:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-02-02 14:52:58 +01:00
|
|
|
|
public partial class Pushpin
|
2021-01-17 21:39:42 +01:00
|
|
|
|
{
|
|
|
|
|
|
public Pushpin()
|
|
|
|
|
|
{
|
|
|
|
|
|
DefaultStyleKey = typeof(Pushpin);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|