MapLayer/MapLayerItemsSource

This commit is contained in:
ClemensFischer 2025-08-12 11:33:39 +02:00
parent bb47829cd3
commit 21ac686843
5 changed files with 24 additions and 78 deletions

View file

@ -1,8 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
#if UWP
#if UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media;
#else
@ -25,30 +21,6 @@ namespace MapControl
DependencyPropertyHelper.RegisterAttached<BoundingBox>("BoundingBox", typeof(MapPanel), null,
(element, oldValue, newValue) => (element.Parent as MapPanel)?.InvalidateArrange());
protected IEnumerable<FrameworkElement> ChildElements => Children.OfType<FrameworkElement>();
protected FrameworkElement GetChildElement(int index) => index < Children.Count ? (FrameworkElement)Children[index] : null;
protected void InsertChildElement(int index, FrameworkElement element) => Children.Insert(index, element);
protected void InsertChildElements(int index, IEnumerable<FrameworkElement> elements)
{
foreach (var element in elements)
{
Children.Insert(index++, element);
}
}
protected void RemoveChildElement(int index) => Children.RemoveAt(index);
protected void RemoveChildElements(int index, int count)
{
while (--count >= 0)
{
RemoveChildElement(index);
}
}
public static void InitMapElement(FrameworkElement element)
{
// Workaround for missing property value inheritance.