mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-20 22:05:07 +00:00
field backed properties
This commit is contained in:
parent
be427c195a
commit
c17cbe297f
1 changed files with 7 additions and 11 deletions
|
|
@ -72,10 +72,6 @@ namespace ProjectionDemo
|
||||||
|
|
||||||
public class ViewModel : INotifyPropertyChanged
|
public class ViewModel : INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
private MapProjection currentProjection;
|
|
||||||
private IMapLayer currentLayer;
|
|
||||||
private Location pushpinLocation = new();
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
public List<MapProjection> Projections { get; } = [];
|
public List<MapProjection> Projections { get; } = [];
|
||||||
|
|
@ -84,34 +80,34 @@ namespace ProjectionDemo
|
||||||
|
|
||||||
public MapProjection CurrentProjection
|
public MapProjection CurrentProjection
|
||||||
{
|
{
|
||||||
get => currentProjection;
|
get;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
currentProjection = value;
|
field = value;
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentProjection)));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentProjection)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public IMapLayer CurrentLayer
|
public IMapLayer CurrentLayer
|
||||||
{
|
{
|
||||||
get => currentLayer;
|
get;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
currentLayer = value;
|
field = value;
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentLayer)));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(CurrentLayer)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location PushpinLocation
|
public Location PushpinLocation
|
||||||
{
|
{
|
||||||
get => pushpinLocation;
|
get;
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
pushpinLocation = value;
|
field = value;
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(PushpinLocation)));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(PushpinLocation)));
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(PushpinText)));
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(PushpinText)));
|
||||||
}
|
}
|
||||||
}
|
} = new();
|
||||||
|
|
||||||
public string PushpinText
|
public string PushpinText
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue