From 97ec623f0676707a660d338e7a2e77ec714d15a6 Mon Sep 17 00:00:00 2001 From: Jakub Florkowski Date: Mon, 4 Mar 2024 01:01:23 +0100 Subject: [PATCH] Border inside a frame fix (#18526) --- src/Controls/src/Core/Border/Border.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Controls/src/Core/Border/Border.cs b/src/Controls/src/Core/Border/Border.cs index 9074341a0bcc..5dc71a64456d 100644 --- a/src/Controls/src/Core/Border/Border.cs +++ b/src/Controls/src/Core/Border/Border.cs @@ -64,6 +64,12 @@ void NotifyStrokeShapeChanges() if (strokeShape is VisualElement visualElement) { + // By setting visibility to false, the shape is not + // considered when calculating the size of its container, but can + // still be accessed as a children. In the context of + // border the IsVisible property of shape is not used. + visualElement.IsVisible = false; + AddLogicalChild(visualElement); _strokeShapeChanged ??= (sender, e) => OnPropertyChanged(nameof(StrokeShape)); _strokeShapeProxy ??= new();