Skip to content

Border updates stroke too frequently #24123

@Foda

Description

@Foda

Description

The border control will rebuild the stroke shape when any property changes on the StrokeShape object, including:

  • Window
  • Parent

This causes a significant performance impact when items are added to a list.

This is caused by the following in Controls\src\Core\Border\Border.cs:

_strokeShapeChanged ??= (sender, e) => OnPropertyChanged(nameof(StrokeShape));

These property changes should not trigger a rebuild of the stroke shape since the Border.OnPropertyChanged event only wants to be notified of the following:

  • Height
  • Width
  • StrokeThickness
  • StrokeShape
  • StrokeDashArray

Steps to Reproduce

No response

Link to public reproduction project repository

No response

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

Unknown/Other

Affected platforms

iOS, Android, Windows, macOS

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions