Avalonia Pushpin

This commit is contained in:
ClemensFischer 2024-05-25 15:55:31 +02:00
parent 1788da27bd
commit 8e4110b600
10 changed files with 287 additions and 133 deletions

View file

@ -59,15 +59,14 @@ namespace MapControl
private static readonly DependencyProperty ParentMapProperty =
DependencyPropertyHelper.RegisterAttached<MapPanel, MapBase>("ParentMap", null,
(element, oldValue, newValue) => SetParentMap(element, newValue), true);
private static void SetParentMap(FrameworkElement element, MapBase parentMap)
{
if (element is IMapElement mapElement)
{
mapElement.ParentMap = parentMap;
}
}
(element, oldValue, newValue) =>
{
if (element is IMapElement mapElement)
{
mapElement.ParentMap = newValue;
}
},
true); // inherits
private MapBase parentMap;

View file

@ -14,6 +14,9 @@ using Windows.UI.Xaml.Media;
using Windows.Foundation;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
#elif AVALONIA
using Avalonia.Media;
using HorizontalAlignment = Avalonia.Layout.HorizontalAlignment;
#endif
namespace MapControl