Added DependencyPropertyHelper.AddOwner

This commit is contained in:
ClemensFischer 2026-02-02 14:52:58 +01:00
parent f78bcb33fa
commit a3d25b5084
12 changed files with 119 additions and 133 deletions

View file

@ -1,47 +1,16 @@
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 partial class MapContentControl
{
public static readonly DependencyProperty LocationProperty =
DependencyPropertyHelper.AddOwner<MapContentControl, Location>(MapPanel.LocationProperty);
public static readonly DependencyProperty AutoCollapseProperty =
DependencyPropertyHelper.AddOwner<MapContentControl, bool>(MapPanel.AutoCollapseProperty);
/// <summary>
/// Gets/sets MapPanel.Location.
/// </summary>
public Location Location
{
get => (Location)GetValue(LocationProperty);
set => SetValue(LocationProperty, value);
}
/// <summary>
/// Gets/sets MapPanel.AutoCollapse.
/// </summary>
public bool AutoCollapse
{
get => (bool)GetValue(AutoCollapseProperty);
set => SetValue(AutoCollapseProperty, value);
}
static MapContentControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(MapContentControl), new FrameworkPropertyMetadata(typeof(MapContentControl)));
}
}
/// <summary>
/// MapContentControl with a Pushpin Style.
/// </summary>
public class Pushpin : MapContentControl
public partial class Pushpin
{
static Pushpin()
{