// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// Copyright © Clemens Fischer
// Licensed under the Microsoft Public License (Ms-PL)
using System.Collections.Generic;
#if WPF
using System.Windows;
#elif UWP
using Windows.UI.Xaml;
#elif WINUI
using Microsoft.UI.Xaml;
#endif
namespace MapControl
{
///
/// A multi-polygon defined by a collection of collections of Locations.
/// Allows to draw filled polygons with holes.
///
/// A PolygonCollection (with ObservableCollection of Location elements) may be used
/// for the Polygons property if collection changes of the property itself and its
/// elements are both supposed to trigger UI updates.
///
public class MapMultiPolygon : MapPolypoint
{
public static readonly DependencyProperty PolygonsProperty =
DependencyPropertyHelper.Register>>(nameof(Polygons), null,
(polygon, oldValue, newValue) => polygon.DataCollectionPropertyChanged(oldValue, newValue));
///
/// Gets or sets the Locations that define the multi-polygon points.
///
public IEnumerable> Polygons
{
get => (IEnumerable>)GetValue(PolygonsProperty);
set => SetValue(PolygonsProperty, value);
}
protected override void UpdateData()
{
UpdateData(Polygons);
}
}
}