Skip to content

Commit c4d7a98

Browse files
Takoooooodanwalmsley
authored andcommitted
Merge pull request AvaloniaUI#8291 from AvaloniaUI/fix-fluent-loader
Fix FluentTheme density style
1 parent 66c72be commit c4d7a98

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Avalonia.Themes.Fluent/FluentTheme.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,14 @@ public DensityStyle DensityStyle
8181
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
8282
{
8383
base.OnPropertyChanged(change);
84+
85+
if (_loaded is null)
86+
{
87+
// If style wasn't yet loaded, no need to change children styles,
88+
// it will be applied later in Loaded getter.
89+
return;
90+
}
91+
8492
if (change.Property == ModeProperty)
8593
{
8694
if (Mode == FluentThemeMode.Dark)

0 commit comments

Comments
 (0)