@@ -16,8 +16,6 @@ internal sealed class AppSystemBackdrop : SystemBackdrop
16
16
private XamlRoot root ;
17
17
private SystemBackdropTheme ? prevTheme = null ;
18
18
19
- public SystemBackdropConfiguration SystemBackdropConfiguration { get ; set ; }
20
-
21
19
public AppSystemBackdrop ( bool isSecondaryWindow = false )
22
20
{
23
21
this . isSecondaryWindow = isSecondaryWindow ;
@@ -34,21 +32,21 @@ protected override void OnTargetConnected(ICompositionSupportsSystemBackdrop con
34
32
base . OnTargetConnected ( connectedTarget , xamlRoot ) ;
35
33
this . target = connectedTarget ;
36
34
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 ) ;
40
38
controller ? . AddSystemBackdropTarget ( connectedTarget ) ;
41
39
}
42
40
43
41
protected override void OnDefaultSystemBackdropConfigurationChanged ( ICompositionSupportsSystemBackdrop target , XamlRoot xamlRoot )
44
42
{
45
43
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 )
48
46
return ;
49
47
50
- prevTheme = SystemBackdropConfiguration . Theme ;
51
- SetThinAcrylicBackdropProperties ( acrylicController , SystemBackdropConfiguration . Theme ) ;
48
+ prevTheme = configuration . Theme ;
49
+ SetThinAcrylicBackdropProperties ( acrylicController , configuration . Theme ) ;
52
50
}
53
51
54
52
protected override void OnTargetDisconnected ( ICompositionSupportsSystemBackdrop disconnectedTarget )
@@ -81,9 +79,9 @@ private void OnSettingChanged(object? sender, SettingChangedEventArgs e)
81
79
case nameof ( IAppearanceSettingsService . AppThemeBackdropMaterial ) :
82
80
controller ? . RemoveAllSystemBackdropTargets ( ) ;
83
81
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 ) ;
87
85
newController ? . AddSystemBackdropTarget ( target ) ;
88
86
controller = newController ;
89
87
break ;
0 commit comments