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);
            });
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
 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;
 }