// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
// Copyright © 2024 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 polygon defined by a collection of Locations.
///
public class MapPolygon : MapPolypoint
{
public static readonly DependencyProperty LocationsProperty =
DependencyPropertyHelper.Register>(nameof(Locations), null,
(polygon, oldValue, newValue) => polygon.DataCollectionPropertyChanged(oldValue, newValue));
///
/// Gets or sets the Locations that define the polygon points.
///
#if WPF
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]
#endif
public IEnumerable Locations
{
get => (IEnumerable)GetValue(LocationsProperty);
set => SetValue(LocationsProperty, value);
}
protected override void UpdateData()
{
UpdateData(Locations, true);
}
}
}