2025-08-12 11:33:39 +02:00
|
|
|
|
using System.Windows;
|
2024-05-20 23:24:34 +02:00
|
|
|
|
using System.Windows.Media;
|
2012-11-23 16:16:09 +01:00
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public partial class MapPanel
|
|
|
|
|
|
{
|
2024-05-27 11:05:22 +02:00
|
|
|
|
public static readonly DependencyProperty AutoCollapseProperty =
|
2024-09-13 22:21:38 +02:00
|
|
|
|
DependencyPropertyHelper.RegisterAttached< bool>("AutoCollapse", typeof(MapPanel));
|
2024-05-27 11:05:22 +02:00
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty LocationProperty =
|
2024-09-13 22:21:38 +02:00
|
|
|
|
DependencyPropertyHelper.RegisterAttached<Location>("Location", typeof(MapPanel), null,
|
2024-05-27 11:05:22 +02:00
|
|
|
|
FrameworkPropertyMetadataOptions.AffectsParentArrange);
|
|
|
|
|
|
|
|
|
|
|
|
public static readonly DependencyProperty BoundingBoxProperty =
|
2024-09-13 22:21:38 +02:00
|
|
|
|
DependencyPropertyHelper.RegisterAttached<BoundingBox>("BoundingBox", typeof(MapPanel), null,
|
2024-05-27 11:05:22 +02:00
|
|
|
|
FrameworkPropertyMetadataOptions.AffectsParentArrange);
|
|
|
|
|
|
|
2021-01-17 00:31:30 +01:00
|
|
|
|
public static MapBase GetParentMap(FrameworkElement element)
|
2013-04-12 19:59:16 +02:00
|
|
|
|
{
|
2021-01-17 00:31:30 +01:00
|
|
|
|
return (MapBase)element.GetValue(ParentMapProperty);
|
2013-04-12 19:59:16 +02:00
|
|
|
|
}
|
2018-04-30 23:13:50 +02:00
|
|
|
|
|
2024-05-20 23:24:34 +02:00
|
|
|
|
public static void SetRenderTransform(FrameworkElement element, Transform transform, double originX = 0d, double originY = 0d)
|
|
|
|
|
|
{
|
|
|
|
|
|
element.RenderTransform = transform;
|
|
|
|
|
|
element.RenderTransformOrigin = new Point(originX, originY);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private static void SetVisible(FrameworkElement element, bool visible)
|
2018-04-30 23:13:50 +02:00
|
|
|
|
{
|
2024-05-20 23:24:34 +02:00
|
|
|
|
element.Visibility = visible ? Visibility.Visible : Visibility.Collapsed;
|
2018-04-30 23:13:50 +02:00
|
|
|
|
}
|
2012-11-23 16:16:09 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|