mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-06 06:55:04 +00:00
Avalonia Pushpin
This commit is contained in:
parent
1788da27bd
commit
8e4110b600
10 changed files with 287 additions and 133 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue