mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 06:26:41 +00:00
C#14 field backed properties
This commit is contained in:
parent
5d390071c6
commit
be427c195a
20 changed files with 89 additions and 106 deletions
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net10.0-windows;net462</TargetFrameworks>
|
||||
<LangVersion Condition="'$(TargetFramework)'=='net462'">12.0</LangVersion>
|
||||
<LangVersion Condition="'$(TargetFramework)'=='net462'">14.0</LangVersion>
|
||||
<UseWPF>true</UseWPF>
|
||||
<DefineConstants>WPF</DefineConstants>
|
||||
<RootNamespace>MapControl</RootNamespace>
|
||||
|
|
|
|||
|
|
@ -18,26 +18,24 @@ namespace MapControl
|
|||
public static readonly DependencyProperty FontSizeProperty =
|
||||
TextElement.FontSizeProperty.AddOwner(typeof(MapGraticule), new FrameworkPropertyMetadata(12d));
|
||||
|
||||
private MapBase parentMap;
|
||||
|
||||
/// <summary>
|
||||
/// Implements IMapElement.ParentMap.
|
||||
/// </summary>
|
||||
public MapBase ParentMap
|
||||
{
|
||||
get => parentMap;
|
||||
get;
|
||||
set
|
||||
{
|
||||
if (parentMap != null)
|
||||
if (field != null)
|
||||
{
|
||||
parentMap.ViewportChanged -= OnViewportChanged;
|
||||
field.ViewportChanged -= OnViewportChanged;
|
||||
}
|
||||
|
||||
parentMap = value;
|
||||
field = value;
|
||||
|
||||
if (parentMap != null)
|
||||
if (field != null)
|
||||
{
|
||||
parentMap.ViewportChanged += OnViewportChanged;
|
||||
field.ViewportChanged += OnViewportChanged;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -49,7 +47,7 @@ namespace MapControl
|
|||
|
||||
protected override void OnRender(DrawingContext drawingContext)
|
||||
{
|
||||
if (parentMap != null)
|
||||
if (ParentMap != null)
|
||||
{
|
||||
var pathGeometry = new PathGeometry();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue