Changed struct Location to class

This commit is contained in:
ClemensFischer 2026-02-01 23:48:56 +01:00
parent 35820aa27e
commit 6429776853
11 changed files with 38 additions and 51 deletions

View file

@ -23,7 +23,7 @@ namespace MapControl
public partial class MapItem : ListBoxItem, IMapElement
{
public static readonly DependencyProperty LocationProperty =
DependencyPropertyHelper.Register<MapItem, Location>(nameof(Location), default,
DependencyPropertyHelper.Register<MapItem, Location>(nameof(Location), null,
(item, oldValue, newValue) =>
{
MapPanel.SetLocation(item, newValue);
@ -109,7 +109,7 @@ namespace MapControl
private void UpdateMapTransform()
{
if (MapTransform != null && ParentMap != null)
if (MapTransform != null && ParentMap != null && Location != null)
{
MapTransform.Matrix = ParentMap.GetMapToViewTransform(Location);
}