mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-16 03:44:27 +00:00
File scoped namespaces
This commit is contained in:
parent
c14377f976
commit
65aba44af6
152 changed files with 11962 additions and 12115 deletions
|
|
@ -2,36 +2,35 @@
|
|||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace MapControl
|
||||
namespace MapControl;
|
||||
|
||||
public partial class MapPath : Shape
|
||||
{
|
||||
public partial class MapPath : Shape
|
||||
public static readonly DependencyProperty DataProperty =
|
||||
DependencyPropertyHelper.AddOwner<MapPath, Geometry>(Path.DataProperty,
|
||||
(path, oldValue, newValue) => path.DataPropertyChanged(oldValue, newValue));
|
||||
|
||||
public Geometry Data
|
||||
{
|
||||
public static readonly DependencyProperty DataProperty =
|
||||
DependencyPropertyHelper.AddOwner<MapPath, Geometry>(Path.DataProperty,
|
||||
(path, oldValue, newValue) => path.DataPropertyChanged(oldValue, newValue));
|
||||
get => (Geometry)GetValue(DataProperty);
|
||||
set => SetValue(DataProperty, value);
|
||||
}
|
||||
|
||||
public Geometry Data
|
||||
protected override Geometry DefiningGeometry => Data;
|
||||
|
||||
private void DataPropertyChanged(Geometry oldValue, Geometry newValue)
|
||||
{
|
||||
// Check if Data is actually a new Geometry.
|
||||
//
|
||||
if (newValue != null && !ReferenceEquals(newValue, oldValue))
|
||||
{
|
||||
get => (Geometry)GetValue(DataProperty);
|
||||
set => SetValue(DataProperty, value);
|
||||
}
|
||||
|
||||
protected override Geometry DefiningGeometry => Data;
|
||||
|
||||
private void DataPropertyChanged(Geometry oldValue, Geometry newValue)
|
||||
{
|
||||
// Check if Data is actually a new Geometry.
|
||||
//
|
||||
if (newValue != null && !ReferenceEquals(newValue, oldValue))
|
||||
if (newValue.IsFrozen)
|
||||
{
|
||||
if (newValue.IsFrozen)
|
||||
{
|
||||
Data = newValue.Clone(); // DataPropertyChanged called again
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateData();
|
||||
}
|
||||
Data = newValue.Clone(); // DataPropertyChanged called again
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue