@@ -11,40 +11,44 @@ public partial class GeneralSettingsViewModel : ObservableObject
1111
1212 public static List < ApplicationTheme > Themes
1313 {
14- #if REVIT2024_OR_GREATER
1514 get =>
1615 [
1716 ApplicationTheme . Light ,
1817 ApplicationTheme . Dark ,
18+ #if REVIT2024_OR_GREATER
1919 ApplicationTheme . Auto
20- ] ;
21- #else
22- get =>
23- [
24- ApplicationTheme . Light ,
25- ApplicationTheme . Dark
26- ] ;
2720#endif
21+ ] ;
2822 }
2923
3024 [ ObservableProperty ] private ApplicationTheme _theme ;
25+ [ ObservableProperty ] private bool _useHardwareRendering ;
3126
3227 partial void OnThemeChanged ( ApplicationTheme value )
3328 {
3429 SettingsService . Instance . GeneralConfig . Theme = value ;
3530 ThemeWatcher . Instance . ApplyTheme ( ) ;
3631 }
3732
33+ partial void OnUseHardwareRenderingChanged ( bool value )
34+ {
35+ SettingsService . Instance . GeneralConfig . UseHardwareRendering = value ;
36+ if ( value ) Application . EnableHardwareRendering ( ) ;
37+ else Application . DisableHardwareRendering ( ) ;
38+ }
39+
3840 private GeneralSettingsViewModel ( )
3941 {
4042 Theme = SettingsService . Instance . GeneralConfig . Theme ;
43+ UseHardwareRendering = SettingsService . Instance . GeneralConfig . UseHardwareRendering ;
4144 }
4245
4346 [ RelayCommand ] private void ResetSettings ( )
4447 {
4548 SettingsService . Instance . ResetVisualizationSettings ( ) ;
4649 SettingsService . Instance . ResetGeneralSettings ( ) ;
4750 Theme = SettingsService . Instance . GeneralConfig . Theme ;
51+ UseHardwareRendering = SettingsService . Instance . GeneralConfig . UseHardwareRendering ;
4852 VisualizationController . Refresh ( ) ;
4953 Trace . TraceInformation ( "Reset settings to default" ) ;
5054 }
0 commit comments