XAML-Map-Control/MapControl/Shared/MapPolyline.cs

38 lines
1 KiB
C#
Raw Normal View History

2025-02-27 18:46:32 +01:00
using System.Collections.Generic;
2024-05-22 11:25:32 +02:00
#if WPF
using System.Windows;
2021-11-17 23:17:11 +01:00
#elif UWP
using Windows.UI.Xaml;
2024-05-22 11:25:32 +02:00
#elif WINUI
using Microsoft.UI.Xaml;
#endif
2026-04-13 17:14:49 +02:00
namespace MapControl;
/// <summary>
/// A polyline defined by a collection of Locations.
/// </summary>
public partial class MapPolyline : MapPolypoint
{
2026-04-13 17:14:49 +02:00
public static readonly DependencyProperty LocationsProperty =
DependencyPropertyHelper.Register<MapPolyline, IEnumerable<Location>>(nameof(Locations), null,
(polyline, oldValue, newValue) => polyline.DataCollectionPropertyChanged(oldValue, newValue));
/// <summary>
2026-04-13 17:14:49 +02:00
/// Gets or sets the Locations that define the polyline points.
/// </summary>
2024-05-27 16:35:02 +02:00
#if WPF
2026-04-13 17:14:49 +02:00
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]
#endif
2026-04-13 17:14:49 +02:00
public IEnumerable<Location> Locations
{
get => (IEnumerable<Location>)GetValue(LocationsProperty);
set => SetValue(LocationsProperty, value);
}
2017-08-04 21:38:58 +02:00
2026-04-13 17:14:49 +02:00
protected override void UpdateData()
{
UpdateData(Locations, false);
}
}