mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
54 lines
1.7 KiB
C#
54 lines
1.7 KiB
C#
// XAML Map Control - https://github.com/ClemensFischer/XAML-Map-Control
|
|
// © 2021 Clemens Fischer
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
|
|
namespace MapControl
|
|
{
|
|
/// <summary>
|
|
/// ContentControl placed on a MapPanel at a geographic location specified by the Location property.
|
|
/// </summary>
|
|
public class MapContentControl : ContentControl
|
|
{
|
|
public static readonly DependencyProperty AutoCollapseProperty = MapPanel.AutoCollapseProperty.AddOwner(typeof(MapContentControl));
|
|
|
|
public static readonly DependencyProperty LocationProperty = MapPanel.LocationProperty.AddOwner(typeof(MapContentControl));
|
|
|
|
static MapContentControl()
|
|
{
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapContentControl), new FrameworkPropertyMetadata(typeof(MapContentControl)));
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets MapPanel.AutoCollapse.
|
|
/// </summary>
|
|
public bool AutoCollapse
|
|
{
|
|
get { return (bool)GetValue(AutoCollapseProperty); }
|
|
set { SetValue(AutoCollapseProperty, value); }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets/sets MapPanel.Location.
|
|
/// </summary>
|
|
public Location Location
|
|
{
|
|
get { return (Location)GetValue(LocationProperty); }
|
|
set { SetValue(LocationProperty, value); }
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// MapContentControl with a Pushpin Style.
|
|
/// </summary>
|
|
public class Pushpin : MapContentControl
|
|
{
|
|
static Pushpin()
|
|
{
|
|
DefaultStyleKeyProperty.OverrideMetadata(typeof(Pushpin), new FrameworkPropertyMetadata(typeof(Pushpin)));
|
|
}
|
|
}
|
|
}
|