File tree Expand file tree Collapse file tree 1 file changed +28
-23
lines changed Expand file tree Collapse file tree 1 file changed +28
-23
lines changed Original file line number Diff line number Diff line change @@ -36,36 +36,41 @@ public static class YilmazturkThemeSelector
36
36
#region Trigger Code
37
37
public static async void Apply ( string theme , Control control )
38
38
{
39
- if ( theme == "light" )
40
- {
41
- ApplyLightTheme ( control ) ;
42
- }
43
- else if ( theme == "dark" )
44
- {
45
- ApplyDarkTheme ( control ) ;
46
- }
47
- else if ( theme == "system" )
48
- {
49
- if ( GetWindowsTheme ( ) == "Default" )
39
+ try {
40
+ if ( theme == "light" )
50
41
{
51
42
ApplyLightTheme ( control ) ;
52
43
}
53
- else
44
+ else if ( theme == "dark" )
54
45
{
55
46
ApplyDarkTheme ( control ) ;
56
47
}
48
+ else if ( theme == "system" )
49
+ {
50
+ if ( GetWindowsTheme ( ) == "Default" )
51
+ {
52
+ ApplyLightTheme ( control ) ;
53
+ }
54
+ else
55
+ {
56
+ ApplyDarkTheme ( control ) ;
57
+ }
58
+ }
59
+ else if ( theme == "systemChange" )
60
+ {
61
+
62
+ controls = control ;
63
+ await tema ( control ) ;
64
+
65
+
66
+ }
67
+ else
68
+ {
69
+ ApplyAnotherTheme ( control ) ;
70
+ }
57
71
}
58
- else if ( theme == "systemChange" )
59
- {
60
-
61
- controls = control ;
62
- await tema ( control ) ;
63
-
64
-
65
- }
66
- else
67
- {
68
- ApplyAnotherTheme ( control ) ;
72
+ catch {
73
+ //linux users, windows 7 and older
69
74
}
70
75
}
71
76
#endregion
You can’t perform that action at this time.
0 commit comments