Julien Lebosquain
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
8 additions and
8 deletions
-
src/Avalonia.Controls/PathIcon.cs
-
src/Avalonia.Controls/Shapes/Path.cs
|
|
|
@ -9,10 +9,10 @@ namespace Avalonia.Controls |
|
|
|
AffectsRender<PathIcon>(DataProperty); |
|
|
|
} |
|
|
|
|
|
|
|
public static readonly StyledProperty<Geometry> DataProperty = |
|
|
|
AvaloniaProperty.Register<PathIcon, Geometry>(nameof(Data)); |
|
|
|
public static readonly StyledProperty<Geometry?> DataProperty = |
|
|
|
AvaloniaProperty.Register<PathIcon, Geometry?>(nameof(Data)); |
|
|
|
|
|
|
|
public Geometry Data |
|
|
|
public Geometry? Data |
|
|
|
{ |
|
|
|
get => GetValue(DataProperty); |
|
|
|
set => SetValue(DataProperty, value); |
|
|
|
|
|
|
|
@ -5,8 +5,8 @@ namespace Avalonia.Controls.Shapes |
|
|
|
{ |
|
|
|
public class Path : Shape |
|
|
|
{ |
|
|
|
public static readonly StyledProperty<Geometry> DataProperty = |
|
|
|
AvaloniaProperty.Register<Path, Geometry>(nameof(Data)); |
|
|
|
public static readonly StyledProperty<Geometry?> DataProperty = |
|
|
|
AvaloniaProperty.Register<Path, Geometry?>(nameof(Data)); |
|
|
|
|
|
|
|
private EventHandler? _geometryChangedHandler; |
|
|
|
|
|
|
|
@ -16,15 +16,15 @@ namespace Avalonia.Controls.Shapes |
|
|
|
DataProperty.Changed.AddClassHandler<Path>((o, e) => o.DataChanged(e)); |
|
|
|
} |
|
|
|
|
|
|
|
public Geometry Data |
|
|
|
public Geometry? Data |
|
|
|
{ |
|
|
|
get => GetValue(DataProperty); |
|
|
|
set => SetValue(DataProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
private EventHandler? GeometryChangedHandler => _geometryChangedHandler ??= GeometryChanged; |
|
|
|
private EventHandler GeometryChangedHandler => _geometryChangedHandler ??= GeometryChanged; |
|
|
|
|
|
|
|
protected override Geometry CreateDefiningGeometry() => Data; |
|
|
|
protected override Geometry? CreateDefiningGeometry() => Data; |
|
|
|
|
|
|
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) |
|
|
|
{ |
|
|
|
|