mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Avalonia Pushpin
This commit is contained in:
parent
1788da27bd
commit
8e4110b600
10 changed files with 287 additions and 133 deletions
|
|
@ -57,16 +57,16 @@ namespace MapControl
|
|||
|
||||
if (parentMap != null)
|
||||
{
|
||||
// Workaround for missing RelativeSource AncestorType=MapBase Bindings in default Style.
|
||||
//
|
||||
if (Background == null)
|
||||
{
|
||||
SetBinding(BackgroundProperty, parentMap.CreateBinding(nameof(Background)));
|
||||
}
|
||||
|
||||
if (Foreground == null)
|
||||
{
|
||||
SetBinding(ForegroundProperty, parentMap.CreateBinding(nameof(Foreground)));
|
||||
}
|
||||
|
||||
if (BorderBrush == null)
|
||||
{
|
||||
SetBinding(BorderBrushProperty, parentMap.CreateBinding(nameof(Foreground)));
|
||||
|
|
|
|||
|
|
@ -23,13 +23,11 @@ namespace MapControl
|
|||
|
||||
public static readonly DependencyProperty LocationProperty =
|
||||
DependencyPropertyHelper.Register<MapItem, Location>(nameof(Location), null,
|
||||
(item, oldValue, newValue) => item.LocationPropertyChanged(newValue));
|
||||
|
||||
private void LocationPropertyChanged(Location location)
|
||||
{
|
||||
MapPanel.SetLocation(this, location);
|
||||
UpdateMapTransform(location);
|
||||
}
|
||||
(item, oldValue, newValue) =>
|
||||
{
|
||||
MapPanel.SetLocation(item, newValue);
|
||||
item.UpdateMapTransform(newValue);
|
||||
});
|
||||
|
||||
public MapItem()
|
||||
{
|
||||
|
|
@ -51,16 +49,16 @@ namespace MapControl
|
|||
|
||||
if (parentMap != null)
|
||||
{
|
||||
// Workaround for missing RelativeSource AncestorType=MapBase Bindings in default Style.
|
||||
//
|
||||
if (Background == null)
|
||||
{
|
||||
SetBinding(BackgroundProperty, parentMap.CreateBinding(nameof(Background)));
|
||||
}
|
||||
|
||||
if (Foreground == null)
|
||||
{
|
||||
SetBinding(ForegroundProperty, parentMap.CreateBinding(nameof(Foreground)));
|
||||
}
|
||||
|
||||
if (BorderBrush == null)
|
||||
{
|
||||
SetBinding(BorderBrushProperty, parentMap.CreateBinding(nameof(Foreground)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue