Update MapPanel.WinUI.cs

This commit is contained in:
ClemensFischer 2025-03-24 23:20:32 +01:00
parent 1228489f9f
commit a9c1a4c320

View file

@ -27,6 +27,7 @@ namespace MapControl
public MapPanel()
{
UseLayoutRounding = false;
InitMapElement(this);
}
@ -40,7 +41,7 @@ namespace MapControl
{
// Workaround for missing property value inheritance.
// Loaded and Unloaded handlers set and clear the ParentMap property value.
//
element.Loaded += (s, e) => GetParentMap((FrameworkElement)s);
element.Unloaded += (s, e) => ((FrameworkElement)s).ClearValue(ParentMapProperty);
}
@ -51,7 +52,7 @@ namespace MapControl
var parentMap = (MapBase)element.GetValue(ParentMapProperty);
// Traverse visual tree because of missing property value inheritance.
//
if (parentMap == null &&
VisualTreeHelper.GetParent(element) is FrameworkElement parentElement)
{