Browse Source

Don't run an unnecessary batch update.

If there are no styles to detach, there's no reason to run a batch update.
pull/8263/head
Steven Kirk 4 years ago
parent
commit
4d23058c9b
  1. 2
      src/Avalonia.Base/StyledElement.cs

2
src/Avalonia.Base/StyledElement.cs

@ -832,7 +832,7 @@ namespace Avalonia
private void DetachStyles()
{
if (_appliedStyles is object)
if (_appliedStyles?.Count > 0)
{
BeginBatchUpdate();

Loading…
Cancel
Save