@@ -20,6 +20,7 @@ public sealed partial class Properties : Page
20
20
private static AppWindowTitleBar _TitleBar ;
21
21
22
22
public AppWindow propWindow ;
23
+
23
24
public ItemPropertiesViewModel ItemProperties { get ; } = new ItemPropertiesViewModel ( ) ;
24
25
25
26
public Properties ( )
@@ -38,13 +39,16 @@ public Properties()
38
39
39
40
private async void Properties_Loaded ( object sender , RoutedEventArgs e )
40
41
{
41
- // Collect AppWindow-specific info
42
- propWindow = Interaction . AppWindows [ UIContext ] ;
43
- // Set properties window titleBar style
44
- _TitleBar = propWindow . TitleBar ;
45
- _TitleBar . ButtonBackgroundColor = Colors . Transparent ;
46
- _TitleBar . ButtonInactiveBackgroundColor = Colors . Transparent ;
47
- App . AppSettings . UpdateThemeElements . Execute ( null ) ;
42
+ if ( ApiInformation . IsApiContractPresent ( "Windows.Foundation.UniversalApiContract" , 8 ) )
43
+ {
44
+ // Collect AppWindow-specific info
45
+ propWindow = Interaction . AppWindows [ UIContext ] ;
46
+ // Set properties window titleBar style
47
+ _TitleBar = propWindow . TitleBar ;
48
+ _TitleBar . ButtonBackgroundColor = Colors . Transparent ;
49
+ _TitleBar . ButtonInactiveBackgroundColor = Colors . Transparent ;
50
+ App . AppSettings . UpdateThemeElements . Execute ( null ) ;
51
+ }
48
52
49
53
if ( App . CurrentInstance . ContentPage . IsItemSelected )
50
54
{
@@ -123,22 +127,25 @@ private async void Properties_Loaded(object sender, RoutedEventArgs e)
123
127
private void AppSettings_ThemeModeChanged ( object sender , EventArgs e )
124
128
{
125
129
RequestedTheme = ThemeHelper . RootTheme ;
126
- switch ( ThemeHelper . RootTheme )
130
+ if ( ApiInformation . IsApiContractPresent ( "Windows.Foundation.UniversalApiContract" , 8 ) )
127
131
{
128
- case ElementTheme . Default :
129
- _TitleBar . ButtonHoverBackgroundColor = ( Color ) Application . Current . Resources [ "SystemBaseLowColor" ] ;
130
- _TitleBar . ButtonForegroundColor = ( Color ) Application . Current . Resources [ "SystemBaseHighColor" ] ;
131
- break ;
132
-
133
- case ElementTheme . Light :
134
- _TitleBar . ButtonHoverBackgroundColor = Color . FromArgb ( 51 , 0 , 0 , 0 ) ;
135
- _TitleBar . ButtonForegroundColor = Colors . Black ;
136
- break ;
137
-
138
- case ElementTheme . Dark :
139
- _TitleBar . ButtonHoverBackgroundColor = Color . FromArgb ( 51 , 255 , 255 , 255 ) ;
140
- _TitleBar . ButtonForegroundColor = Colors . White ;
141
- break ;
132
+ switch ( ThemeHelper . RootTheme )
133
+ {
134
+ case ElementTheme . Default :
135
+ _TitleBar . ButtonHoverBackgroundColor = ( Color ) Application . Current . Resources [ "SystemBaseLowColor" ] ;
136
+ _TitleBar . ButtonForegroundColor = ( Color ) Application . Current . Resources [ "SystemBaseHighColor" ] ;
137
+ break ;
138
+
139
+ case ElementTheme . Light :
140
+ _TitleBar . ButtonHoverBackgroundColor = Color . FromArgb ( 51 , 0 , 0 , 0 ) ;
141
+ _TitleBar . ButtonForegroundColor = Colors . Black ;
142
+ break ;
143
+
144
+ case ElementTheme . Dark :
145
+ _TitleBar . ButtonHoverBackgroundColor = Color . FromArgb ( 51 , 255 , 255 , 255 ) ;
146
+ _TitleBar . ButtonForegroundColor = Colors . White ;
147
+ break ;
148
+ }
142
149
}
143
150
}
144
151
@@ -149,6 +156,10 @@ private async void Button_Click(object sender, RoutedEventArgs e)
149
156
{
150
157
await propWindow . CloseAsync ( ) ;
151
158
}
159
+ else
160
+ {
161
+ App . PropertiesDialogDisplay . Hide ( ) ;
162
+ }
152
163
}
153
164
}
154
165
0 commit comments