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
612c489eb9
commit
bb47829cd3
4 changed files with 107 additions and 56 deletions
|
|
@ -1,5 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
#if UWP
|
||||
using Windows.UI.Xaml;
|
||||
using Windows.UI.Xaml.Media;
|
||||
|
|
@ -25,6 +27,28 @@ namespace MapControl
|
|||
|
||||
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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue