File tree Expand file tree Collapse file tree 4 files changed +29
-16
lines changed
Expand file tree Collapse file tree 4 files changed +29
-16
lines changed Original file line number Diff line number Diff line change 11namespace ResXManager
22{
3+ using System ;
34 using System . Collections . ObjectModel ;
45 using System . ComponentModel ;
56 using System . Composition ;
1011
1112 using ResXManager . Infrastructure ;
1213 using ResXManager . Model ;
13- using ResXManager . Properties ;
1414
1515 using TomsToolbox . Essentials ;
1616 using TomsToolbox . Wpf ;
1717
18- public enum ColorTheme
19- {
20- [ LocalizedDisplayName ( StringResourceKey . ColorTheme_System ) ]
21- System ,
22-
23- [ LocalizedDisplayName ( StringResourceKey . ColorTheme_Light ) ]
24- Light ,
25-
26- [ LocalizedDisplayName ( StringResourceKey . ColorTheme_Dark ) ]
27- Dark
28- }
29-
3018 [ Export ( typeof ( IConfiguration ) ) ]
19+ [ Export ( typeof ( IStandaloneConfiguration ) ) ]
3120 [ Shared ]
32- public class StandaloneConfiguration : Configuration
21+ internal class StandaloneConfiguration : Configuration , IStandaloneConfiguration
3322 {
3423 private readonly Collection < ResourceDictionary > _colorThemeResourceContainer ;
3524
@@ -66,6 +55,8 @@ private void OnColorThemeChanged()
6655 case ColorTheme . Dark :
6756 _colorThemeResourceContainer . Add ( new ResourceDictionary { Source = GetType ( ) . Assembly . GeneratePackUri ( "Themes/DarkTheme.xaml" ) } ) ;
6857 break ;
58+ default :
59+ throw new ArgumentOutOfRangeException ( ) ;
6960 }
7061 }
7162 }
Original file line number Diff line number Diff line change 1+ namespace ResXManager
2+ {
3+ using ResXManager . Properties ;
4+
5+ public enum ColorTheme
6+ {
7+ [ LocalizedDisplayName ( StringResourceKey . ColorTheme_System ) ]
8+ System ,
9+
10+ [ LocalizedDisplayName ( StringResourceKey . ColorTheme_Light ) ]
11+ Light ,
12+
13+ [ LocalizedDisplayName ( StringResourceKey . ColorTheme_Dark ) ]
14+ Dark
15+ }
16+
17+ public interface IStandaloneConfiguration
18+ {
19+ ColorTheme ColorTheme { get ; set ; }
20+ }
21+ }
Original file line number Diff line number Diff line change 8989 <SubType >Designer</SubType >
9090 </ApplicationDefinition >
9191 <Compile Include =" Configuration.cs" />
92+ <Compile Include =" IStandaloneConfiguration.cs" />
9293 <Compile Include =" MainView.xaml.cs" >
9394 <DependentUpon >MainView.xaml</DependentUpon >
9495 </Compile >
Original file line number Diff line number Diff line change 1313 [ Shared ]
1414 internal class ColorThemeConfigurationViewModel : ObservableObject
1515 {
16- public ColorThemeConfigurationViewModel ( StandaloneConfiguration configuration )
16+ public ColorThemeConfigurationViewModel ( IStandaloneConfiguration configuration )
1717 {
1818 Configuration = configuration ;
1919 }
2020
21- public StandaloneConfiguration Configuration { get ; }
21+ public IStandaloneConfiguration Configuration { get ; }
2222 }
2323}
You can’t perform that action at this time.
0 commit comments