Describe the bug
Layoutable.MeasureCore inside WindowDrawnDecorationsContent returns full size even when IsVisible is set to false via Window.Styles.
To Reproduce
Add a theme for WindowDrawnDecorations to Application.Styles
<ControlTheme x:Key="{x:Type WindowDrawnDecorations}" TargetType="WindowDrawnDecorations">
<Setter Property="Template">
<WindowDrawnDecorationsTemplate>
<WindowDrawnDecorationsContent>
<WindowDrawnDecorationsContent.Overlay>
<!-- Overlay: only interactive caption buttons -->
<ContentControl>
<StackPanel VerticalAlignment="Top"
HorizontalAlignment="Right"
Height="{TemplateBinding TitleBarHeight}"
Orientation="Horizontal"
Background="Black">
<Rectangle x:Name="A" Fill="Red" Width="30" />
<Rectangle x:Name="B" Fill="Green" Width="30" />
<Rectangle x:Name="C" Fill="Blue" Width="30" />
</StackPanel>
</ContentControl>
</WindowDrawnDecorationsContent.Overlay>
</WindowDrawnDecorationsContent>
</WindowDrawnDecorationsTemplate>
</Setter>
</ControlTheme>
Set IsVisibleProperty of controls inside WindowDrawnDecorationsContent via Window.Styles
<Style Selector="WindowDrawnDecorations /template/ Rectangle#B">
<Setter Property="IsVisible" Value="False" />
</Style>
Enable client decorations for the window
<Window ...
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaTitleBarHeightHint="30">
...
</Window>
Rectangle#B is hidden, but the StackPanel stills takes up a layout of three rectangles (Width: 90).
Expected behavior
StackPanel.Width should be 60 for above example
Avalonia version
12.0.4
OS
Windows
Additional context
No response
Describe the bug
Layoutable.MeasureCoreinsideWindowDrawnDecorationsContentreturns full size even whenIsVisibleis set to false viaWindow.Styles.To Reproduce
Add a theme for WindowDrawnDecorations to Application.Styles
Set IsVisibleProperty of controls inside WindowDrawnDecorationsContent via Window.Styles
Enable client decorations for the window
Rectangle#B is hidden, but the StackPanel stills takes up a layout of three rectangles (Width: 90).
Expected behavior
StackPanel.Width should be 60 for above example
Avalonia version
12.0.4
OS
Windows
Additional context
No response