From 8363dcfe14a749c47daac28155a0f3afc43d6c67 Mon Sep 17 00:00:00 2001 From: Mike Corsaro Date: Sat, 10 Aug 2024 06:47:00 -0700 Subject: [PATCH] Ensure border stroke does not regenerate on Parent or Window property changes (#24125) Co-authored-by: Mike Corsaro --- src/Controls/src/Core/Border/Border.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Controls/src/Core/Border/Border.cs b/src/Controls/src/Core/Border/Border.cs index 570f1c93d1e0..8cfeac05a0d1 100644 --- a/src/Controls/src/Core/Border/Border.cs +++ b/src/Controls/src/Core/Border/Border.cs @@ -65,7 +65,14 @@ void NotifyStrokeShapeChanges() if (strokeShape is VisualElement visualElement) { AddLogicalChild(visualElement); - _strokeShapeChanged ??= (sender, e) => OnPropertyChanged(nameof(StrokeShape)); + _strokeShapeChanged ??= (sender, e) => + { + if (e.PropertyName != nameof(Window) && + e.PropertyName != nameof(Parent)) + { + OnPropertyChanged(nameof(StrokeShape)); + } + }; _strokeShapeProxy ??= new(); _strokeShapeProxy.Subscribe(visualElement, _strokeShapeChanged); }