mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
MapLayer/MapLayerItemsSource
This commit is contained in:
parent
bb47829cd3
commit
21ac686843
5 changed files with 24 additions and 78 deletions
|
|
@ -1,6 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace MapControl
|
||||
|
|
@ -18,24 +16,6 @@ namespace MapControl
|
|||
DependencyPropertyHelper.RegisterAttached<BoundingBox>("BoundingBox", typeof(MapPanel), null,
|
||||
FrameworkPropertyMetadataOptions.AffectsParentArrange);
|
||||
|
||||
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) => Children.RemoveRange(index, count);
|
||||
|
||||
public static MapBase GetParentMap(FrameworkElement element)
|
||||
{
|
||||
return (MapBase)element.GetValue(ParentMapProperty);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue