Skip to content

Commit

Permalink
Ensure border stroke does not regenerate on Parent or Window property…
Browse files Browse the repository at this point in the history
… changes (#24125)

Co-authored-by: Mike Corsaro <mikecorsaro@microsoft.com>
  • Loading branch information
Foda and Mike Corsaro authored Aug 10, 2024
1 parent 3b7791b commit 8363dcf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Controls/src/Core/Border/Border.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8363dcf

Please sign in to comment.