@@ -16,8 +16,6 @@ internal sealed class AppSystemBackdrop : SystemBackdrop
1616 private XamlRoot root ;
1717 private SystemBackdropTheme ? prevTheme = null ;
1818
19- public SystemBackdropConfiguration SystemBackdropConfiguration { get ; set ; }
20-
2119 public AppSystemBackdrop ( bool isSecondaryWindow = false )
2220 {
2321 this . isSecondaryWindow = isSecondaryWindow ;
@@ -34,21 +32,21 @@ protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop con
3432 base . OnTargetConnected ( connectedTarget , xamlRoot ) ;
3533 this . target = connectedTarget ;
3634 this . root = xamlRoot ;
37- SystemBackdropConfiguration = GetDefaultSystemBackdropConfiguration ( connectedTarget , xamlRoot ) ;
38- controller = GetSystemBackdropController ( userSettingsService . AppearanceSettingsService . AppThemeBackdropMaterial , SystemBackdropConfiguration . Theme ) ;
39- controller ? . SetSystemBackdropConfiguration ( SystemBackdropConfiguration ) ;
35+ var configuration = GetDefaultSystemBackdropConfiguration ( connectedTarget , xamlRoot ) ;
36+ controller = GetSystemBackdropController ( userSettingsService . AppearanceSettingsService . AppThemeBackdropMaterial , configuration . Theme ) ;
37+ controller ? . SetSystemBackdropConfiguration ( configuration ) ;
4038 controller ? . AddSystemBackdropTarget ( connectedTarget ) ;
4139 }
4240
4341 protected override void OnDefaultSystemBackdropConfigurationChanged ( ICompositionSupportsSystemBackdrop target , XamlRoot xamlRoot )
4442 {
4543 base . OnDefaultSystemBackdropConfigurationChanged ( target , xamlRoot ) ;
46- SystemBackdropConfiguration = GetDefaultSystemBackdropConfiguration ( target , xamlRoot ) ;
47- if ( controller is not DesktopAcrylicController acrylicController || acrylicController . Kind != DesktopAcrylicKind . Thin || SystemBackdropConfiguration . Theme == prevTheme )
44+ var configuration = GetDefaultSystemBackdropConfiguration ( target , xamlRoot ) ;
45+ if ( controller is not DesktopAcrylicController acrylicController || acrylicController . Kind != DesktopAcrylicKind . Thin || configuration . Theme == prevTheme )
4846 return ;
4947
50- prevTheme = SystemBackdropConfiguration . Theme ;
51- SetThinAcrylicBackdropProperties ( acrylicController , SystemBackdropConfiguration . Theme ) ;
48+ prevTheme = configuration . Theme ;
49+ SetThinAcrylicBackdropProperties ( acrylicController , configuration . Theme ) ;
5250 }
5351
5452 protected override void OnTargetDisconnected ( ICompositionSupportsSystemBackdrop disconnectedTarget )
@@ -81,9 +79,9 @@ private void OnSettingChanged(object? sender, SettingChangedEventArgs e)
8179 case nameof ( IAppearanceSettingsService . AppThemeBackdropMaterial ) :
8280 controller ? . RemoveAllSystemBackdropTargets ( ) ;
8381 controller ? . Dispose ( ) ;
84- SystemBackdropConfiguration = GetDefaultSystemBackdropConfiguration ( target , root ) ;
85- var newController = GetSystemBackdropController ( ( BackdropMaterialType ) e . NewValue ! , SystemBackdropConfiguration . Theme ) ;
86- newController ? . SetSystemBackdropConfiguration ( SystemBackdropConfiguration ) ;
82+ var configuration = GetDefaultSystemBackdropConfiguration ( target , root ) ;
83+ var newController = GetSystemBackdropController ( ( BackdropMaterialType ) e . NewValue ! , configuration . Theme ) ;
84+ newController ? . SetSystemBackdropConfiguration ( configuration ) ;
8785 newController ? . AddSystemBackdropTarget ( target ) ;
8886 controller = newController ;
8987 break ;
0 commit comments