|
|
|
@ -90,10 +90,18 @@ namespace Avalonia |
|
|
|
public static readonly StyledProperty<int> ZIndexProperty = |
|
|
|
AvaloniaProperty.Register<Visual, int>(nameof(ZIndex)); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Defines the <see cref="WantsLayer"/> property.
|
|
|
|
/// </summary>
|
|
|
|
public static readonly DirectProperty<Visual, bool> WantsLayerProperty = |
|
|
|
AvaloniaProperty.RegisterDirect<Visual, bool>("WantsLayer", o => o._wantsLayer, |
|
|
|
(o, v) => o._wantsLayer = v); |
|
|
|
|
|
|
|
private Rect _bounds; |
|
|
|
private TransformedBounds? _transformedBounds; |
|
|
|
private IRenderRoot _visualRoot; |
|
|
|
private IVisual _visualParent; |
|
|
|
private bool _wantsLayer; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes static members of the <see cref="Visual"/> class.
|
|
|
|
@ -105,7 +113,8 @@ namespace Avalonia |
|
|
|
ClipProperty, |
|
|
|
ClipToBoundsProperty, |
|
|
|
IsVisibleProperty, |
|
|
|
OpacityProperty); |
|
|
|
OpacityProperty, |
|
|
|
WantsLayerProperty); |
|
|
|
RenderTransformProperty.Changed.Subscribe(RenderTransformChanged); |
|
|
|
} |
|
|
|
|
|
|
|
@ -239,6 +248,15 @@ namespace Avalonia |
|
|
|
private set; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Allows to explicitly force a rendering layer for a particular visual. Use with caution.
|
|
|
|
/// </summary>
|
|
|
|
public bool WantsLayer |
|
|
|
{ |
|
|
|
get => GetValue(WantsLayerProperty); |
|
|
|
set => SetValue(WantsLayerProperty, value); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the root of the visual tree, if the control is attached to a visual tree.
|
|
|
|
/// </summary>
|
|
|
|
|