Example #1
0
        /// <summary>
        /// Applies a new theme based on the changed selection in the input element.
        /// </summary>
        /// <param name="ts"></param>
        public void ApplyTheme(FrameworkElement fe, string themeName)
        {
            if (themeName != null)
            {
                IsEnabled = false;
                try
                {
                    var settings = GetService <ISettingsManager>(); // add the default themes

                    Color AccentColor = ThemeViewModel.GetCurrentAccentColor(settings);
                    GetService <IAppearanceManager>().SetTheme(settings.Themes, themeName, AccentColor);

                    IThemeInfo o;
                    _ListOfThemes.TryGetValue(themeName, out o);
                    SelectedTheme = o;
                }
                catch
                {
                }
                finally
                {
                    IsEnabled = true;
                }
            }
        }
Example #2
0
        /// <summary>
        /// Hidden standard constructor
        /// </summary>
        protected AppViewModel()
        {
            _AppTheme = new ThemeViewModel();

            _TargetFile              = new FileViewModel();
            _SourceFiles             = new ObservableCollection <FileInfoViewModel>();
            _SelectedSourceFileItems = new ObservableCollection <FileInfoViewModel>();

            _Progress = new ProgressViewModel();
        }
Example #3
0
        /// <summary>
        /// Hidden standard constructor
        /// </summary>
        protected AppViewModel()
        {
            _AppTheme = new ThemeViewModel();

            _TargetFile              = new FileViewModel();
            _SourceFiles             = new ObservableCollection <FileInfoViewModel>();
            _SelectedSourceFileItems = new ObservableCollection <FileInfoViewModel>();

            _Progress = new ProgressViewModel();

            BookmarkedLocations = FileSystemModels.Factory.CreateBookmarksViewModel();

            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments));
            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyVideos));
            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.MyMusic));
            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile));
            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.Windows));
            BookmarkedLocations.AddFolder(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles));
        }