2017-06-25 23:05:48 +02:00
|
|
|
|
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
2025-01-01 18:57:55 +01:00
|
|
|
|
// Copyright © Clemens Fischer
|
2012-11-23 16:16:09 +01:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
2021-01-11 22:35:17 +01:00
|
|
|
|
using System.Windows;
|
2017-09-05 20:57:17 +02:00
|
|
|
|
using System.Windows.Controls;
|
2012-12-06 23:28:12 +01:00
|
|
|
|
|
2012-11-23 16:16:09 +01:00
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
2012-12-06 23:28:12 +01:00
|
|
|
|
/// <summary>
|
2021-01-17 21:39:42 +01:00
|
|
|
|
/// ContentControl placed on a MapPanel at a geographic location specified by the Location property.
|
2012-12-06 23:28:12 +01:00
|
|
|
|
/// </summary>
|
2021-01-17 21:39:42 +01:00
|
|
|
|
public class MapContentControl : ContentControl
|
2012-11-23 16:16:09 +01:00
|
|
|
|
{
|
2024-05-23 18:08:14 +02:00
|
|
|
|
public static readonly DependencyProperty AutoCollapseProperty =
|
2024-05-24 15:14:05 +02:00
|
|
|
|
DependencyPropertyHelper.AddOwner<MapContentControl, bool>(MapPanel.AutoCollapseProperty);
|
2021-01-13 00:08:55 +01:00
|
|
|
|
|
2024-05-23 18:08:14 +02:00
|
|
|
|
public static readonly DependencyProperty LocationProperty =
|
2024-05-24 15:14:05 +02:00
|
|
|
|
DependencyPropertyHelper.AddOwner<MapContentControl, Location>(MapPanel.LocationProperty);
|
2016-08-08 20:36:02 +02:00
|
|
|
|
|
2021-01-17 21:39:42 +01:00
|
|
|
|
static MapContentControl()
|
2021-01-17 00:31:30 +01:00
|
|
|
|
{
|
2021-01-17 21:39:42 +01:00
|
|
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapContentControl), new FrameworkPropertyMetadata(typeof(MapContentControl)));
|
2016-08-08 20:36:02 +02:00
|
|
|
|
}
|
2018-02-09 17:43:47 +01:00
|
|
|
|
|
2021-01-13 00:08:55 +01:00
|
|
|
|
/// <summary>
|
2021-01-16 18:32:31 +01:00
|
|
|
|
/// Gets/sets MapPanel.AutoCollapse.
|
2021-01-13 00:08:55 +01:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool AutoCollapse
|
|
|
|
|
|
{
|
2022-08-06 10:40:59 +02:00
|
|
|
|
get => (bool)GetValue(AutoCollapseProperty);
|
|
|
|
|
|
set => SetValue(AutoCollapseProperty, value);
|
2021-01-13 00:08:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2021-01-16 18:32:31 +01:00
|
|
|
|
/// Gets/sets MapPanel.Location.
|
2021-01-13 00:08:55 +01:00
|
|
|
|
/// </summary>
|
2018-02-09 17:43:47 +01:00
|
|
|
|
public Location Location
|
|
|
|
|
|
{
|
2022-08-06 10:40:59 +02:00
|
|
|
|
get => (Location)GetValue(LocationProperty);
|
|
|
|
|
|
set => SetValue(LocationProperty, value);
|
2018-02-09 17:43:47 +01:00
|
|
|
|
}
|
2012-11-23 16:16:09 +01:00
|
|
|
|
}
|
2021-01-17 21:39:42 +01:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// MapContentControl with a Pushpin Style.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class Pushpin : MapContentControl
|
|
|
|
|
|
{
|
|
|
|
|
|
static Pushpin()
|
|
|
|
|
|
{
|
|
|
|
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(Pushpin), new FrameworkPropertyMetadata(typeof(Pushpin)));
|
|
|
|
|
|
}
|
2022-02-09 23:10:54 +01:00
|
|
|
|
|
2024-05-23 18:08:14 +02:00
|
|
|
|
public static readonly DependencyProperty CornerRadiusProperty =
|
|
|
|
|
|
DependencyPropertyHelper.Register<Pushpin, CornerRadius>(nameof(CornerRadius));
|
2022-02-09 23:10:54 +01:00
|
|
|
|
|
|
|
|
|
|
public CornerRadius CornerRadius
|
|
|
|
|
|
{
|
2022-08-06 10:40:59 +02:00
|
|
|
|
get => (CornerRadius)GetValue(CornerRadiusProperty);
|
|
|
|
|
|
set => SetValue(CornerRadiusProperty, value);
|
2022-02-09 23:10:54 +01:00
|
|
|
|
}
|
2021-01-17 21:39:42 +01:00
|
|
|
|
}
|
2012-11-23 16:16:09 +01:00
|
|
|
|
}
|