コード例 #1
0
        public SettingsModuleViewModel(IStateManager state_manager,
                                       IThemeController theme_controller,
                                       ApplicationNavigationPartViewModel application_navigation_part,
                                       ToolsNavigationPartViewModel tools_navigation_part)
        {
            this.state_manager        = state_manager;
            this.theme_controller     = theme_controller;
            ApplicationNavigationPart = application_navigation_part;
            ToolsNavigationPart       = tools_navigation_part;

            this.WhenAnyValue(x => x.SelectedPrimaryColor)
            .Where(swatch => swatch != null)
            .Select(swatch => swatch.Name)
            .Subscribe(swatch_name =>
            {
                state_manager.Settings.PrimaryColorName = swatch_name;
                theme_controller.SetPrimary(swatch_name);
            });

            this.WhenAnyValue(x => x.SelectedAccentColor)
            .Where(swatch => swatch != null)
            .Select(swatch => swatch.Name)
            .Subscribe(swatch_name =>
            {
                state_manager.Settings.AccentColorName = swatch_name;
                theme_controller.SetAccent(swatch_name);
            });

            this.WhenAnyValue(x => x.IsThemeDark)
            .Subscribe(x =>
            {
                state_manager.Settings.IsDarkTheme = IsThemeDark;
                theme_controller.SetBase(IsThemeDark);
            });
        }
コード例 #2
0
ファイル: ThemeViewModel.cs プロジェクト: pmfai25/WPFTemplate
        public ThemeViewModel(IThemeController controller)
        {
            this.controller = controller;

            Themes  = controller.Themes;
            Accents = controller.Accents;

            CurrentTheme  = Themes.Single(t => t.Name == controller.CurrentTheme.Name);
            CurrentAccent = Accents.Single(a => a.Name == controller.CurrentAccent.Name);
        }
コード例 #3
0
ファイル: ThemeViewModel.cs プロジェクト: Corne/WPFTemplate
        public ThemeViewModel(IThemeController controller)
        {
            this.controller = controller;

            Themes = controller.Themes;
            Accents = controller.Accents;

            CurrentTheme = Themes.Single(t => t.Name == controller.CurrentTheme.Name);
            CurrentAccent = Accents.Single(a => a.Name == controller.CurrentAccent.Name);
        }
コード例 #4
0
 public ApplicationController(IStateManager state_manager,
                              IShellViewModel shell,
                              ISearchEngine <Book> search_engine,
                              IBackgroundProcessor background_processor,
                              IGoodreadsController goodreads_controller,
                              IThemeController theme_controller)
 {
     this.state_manager        = state_manager;
     this.shell                = shell;
     this.search_engine        = search_engine;
     this.background_processor = background_processor;
     this.goodreads_controller = goodreads_controller;
     this.theme_controller     = theme_controller;
 }