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

39 lines
1.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
namespace MapControl
{
/// <summary>
/// A polyline defined by a collection of Locations.
/// </summary>
2024-05-26 09:49:00 +02:00
public class MapPolyline : MapPolypoint
{
2024-05-23 18:08:14 +02:00
public static readonly DependencyProperty LocationsProperty =
2024-05-23 18:22:52 +02:00
DependencyPropertyHelper.Register<MapPolyline, IEnumerable<Location>>(nameof(Locations), null,
2024-05-23 18:08:14 +02:00
(polyline, oldValue, newValue) => polyline.DataCollectionPropertyChanged(oldValue, newValue));
2017-08-04 21:38:58 +02:00
/// <summary>
/// Gets or sets the Locations that define the polyline points.
2017-08-04 21:38:58 +02:00
/// </summary>
2024-05-27 16:35:02 +02:00
#if WPF
2021-06-14 21:41:37 +02:00
[System.ComponentModel.TypeConverter(typeof(LocationCollectionConverter))]
#endif
2017-08-04 21:38:58 +02:00
public IEnumerable<Location> Locations
{
2022-08-06 10:40:59 +02:00
get => (IEnumerable<Location>)GetValue(LocationsProperty);
set => SetValue(LocationsProperty, value);
2017-08-04 21:38:58 +02:00
}
protected override void UpdateData()
{
2024-05-26 09:49:00 +02:00
UpdateData(Locations, false);
}
}
}