|
|
@@ -6,9 +6,18 @@ namespace Avalonia.Controls
|
|
|
{
|
|
|
public class DrawingPresenter : Control
|
|
|
{
|
|
|
+ static DrawingPresenter()
|
|
|
+ {
|
|
|
+ AffectsMeasure(DrawingProperty);
|
|
|
+ AffectsRender(DrawingProperty);
|
|
|
+ }
|
|
|
+
|
|
|
public static readonly StyledProperty<Drawing> DrawingProperty =
|
|
|
AvaloniaProperty.Register<DrawingPresenter, Drawing>(nameof(Drawing));
|
|
|
|
|
|
+ public static readonly StyledProperty<Stretch> StretchProperty =
|
|
|
+ AvaloniaProperty.Register<DrawingPresenter, Stretch>(nameof(Stretch), Stretch.Uniform);
|
|
|
+
|
|
|
[Content]
|
|
|
public Drawing Drawing
|
|
|
{
|
|
|
@@ -16,21 +25,12 @@ namespace Avalonia.Controls
|
|
|
set => SetValue(DrawingProperty, value);
|
|
|
}
|
|
|
|
|
|
- public static readonly StyledProperty<Stretch> StretchProperty =
|
|
|
- AvaloniaProperty.Register<DrawingPresenter, Stretch>(nameof(Stretch), Stretch.Uniform);
|
|
|
-
|
|
|
public Stretch Stretch
|
|
|
{
|
|
|
get => GetValue(StretchProperty);
|
|
|
set => SetValue(StretchProperty, value);
|
|
|
}
|
|
|
|
|
|
- static DrawingPresenter()
|
|
|
- {
|
|
|
- AffectsMeasure(DrawingProperty);
|
|
|
- AffectsRender(DrawingProperty);
|
|
|
- }
|
|
|
-
|
|
|
private Matrix _transform = Matrix.Identity;
|
|
|
|
|
|
protected override Size MeasureOverride(Size availableSize)
|