Exemplo n.º 1
0
        private void InitializeTheming()
        {
            try
            {
                ThemeManager.AddTheme(new Uri("pack://application:,,,/InteractiveSeven;component/Theming/CustomAccents/DarkAccent1.xaml"));
                ThemeManager.AddTheme(new Uri("pack://application:,,,/InteractiveSeven;component/Theming/CustomAccents/DarkAccent2.xaml"));
                ThemeManager.AddTheme(new Uri("pack://application:,,,/InteractiveSeven;component/Theming/CustomAccents/LightAccent1.xaml"));
                ThemeManager.AddTheme(new Uri("pack://application:,,,/InteractiveSeven;component/Theming/CustomAccents/LightAccent2.xaml"));

                ThemeManager.IsAutomaticWindowsAppModeSettingSyncEnabled = true;
                ThemeManager.SyncThemeWithWindowsAppModeSetting();

                // create custom accents
                ThemeManagerHelper.CreateTheme("Dark", Colors.Red, "CustomAccentDarkRed");
                ThemeManagerHelper.CreateTheme("Light", Colors.Red, "CustomAccentLightRed");
                ThemeManagerHelper.CreateTheme("Dark", Colors.GreenYellow);
                ThemeManagerHelper.CreateTheme("Light", Colors.GreenYellow);
                ThemeManagerHelper.CreateTheme("Dark", Colors.Indigo);
                ThemeManagerHelper.CreateTheme("Light", Colors.Indigo, changeImmediately: true);

                Theme theme = LoadCurrentTheme();

                ThemeManager.ChangeTheme(Current, theme);

                ThemeManager.IsThemeChanged += ThemeManager_IsThemeChanged;
            }
            catch (Exception themeEx)
            {
                _logger.LogError(themeEx, "Error Initializing Application Theming");
            }
        }
Exemplo n.º 2
0
        /// <inheritdoc />
        protected override void OnStartup(StartupEventArgs e)
        {
            var themeManagerHelper = new ThemeManagerHelper();

            themeManagerHelper.RegisterSystemColorTheme();

            base.OnStartup(e);
        }
Exemplo n.º 3
0
        private void ColorsSelectorOnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedColor = this.ColorsSelector.SelectedItem as KeyValuePair <string, Color>?;

            if (selectedColor.HasValue)
            {
                var theme = ThemeManager.DetectAppStyle(Application.Current);
                ThemeManagerHelper.CreateAppStyleBy(selectedColor.Value.Value, true);
                Application.Current.MainWindow.Activate();
            }
        }
        public MainWindow()
        {
            InitializeComponent();
            IApplicationSettingsBaseHelper applicationSettingsBaseHelper = new ApplicationSettingsBaseHelper(Settings.Default);
            ISettings           coreSettings       = new CoreSettings(applicationSettingsBaseHelper);
            IThemeManagerHelper themeManagerHelper = new ThemeManagerHelper();
            IMetroStyle         style  = new MetroStyle(this, coreSettings, themeManagerHelper);
            IFlyout             flyout = new CustomFlyout(this, style, Assembly.GetExecutingAssembly().GetLinkerTime());

            flyout.Run();
        }
Exemplo n.º 5
0
        /// <summary>
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            _coreSettings = new CoreSettings(Properties.Settings.Default);
            var themeManagerHelper = new ThemeManagerHelper();

            _style = new MetroStyle(this, Accent, ThemeSwitch, _coreSettings, themeManagerHelper);
            _style.Load(true);
            var linkerTime = Assembly.GetExecutingAssembly().GetLinkerTime();

            LinkerTime.Content = linkerTime.ToString(CultureInfo.InvariantCulture);
            Load();
        }
Exemplo n.º 6
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // add custom accent and theme resource dictionaries
            ThemeManager.AddAccent("CustomAccent1", new Uri("pack://application:,,,/MC;component/Source/Graphics/CustomAccent1.xaml"));
            ThemeManager.AddAccent("CustomAccent2", new Uri("pack://application:,,,/MC;component/Source/Graphics/CustomAccent2.xaml"));
            ThemeManager.AddAppTheme("CustomTheme", new Uri("pack://application:,,,/MC;component/Source/Graphics/CustomTheme.xaml"));

            // create custom accents
            ThemeManagerHelper.CreateAppStyleBy(Colors.Red);
            ThemeManagerHelper.CreateAppStyleBy(Colors.GreenYellow);
            ThemeManagerHelper.CreateAppStyleBy(Colors.Indigo, true);

            base.OnStartup(e);
        }
Exemplo n.º 7
0
        private void GetSavedTheme()
        {
            var settingsFIle = _staticParams.SettingsFile;
            var color        = File.ReadLines(settingsFIle).FirstOrDefault();

            if (ThemeManager.Accents.Any(a => a.Name == color))
            {
                ThemeManager.ChangeAppStyle(Application.Current,
                                            ThemeManager.GetAccent(color),
                                            ThemeManager.GetAppTheme("BaseLight"));
            }
            else if (color != null)
            {
                var themeColor = (Color)ColorConverter.ConvertFromString(color);
                var theme      = ThemeManager.DetectAppStyle(Application.Current);
                ThemeManagerHelper.CreateAppStyleBy(themeColor, true);
                Application.Current.MainWindow.Activate();
            }
        }
Exemplo n.º 8
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            // add custom accent and theme resource dictionaries
            ThemeManager.AddAccent("CustomAccent1", new Uri("pack://application:,,,/SpaSolutions;component/CustomAccents/CustomAccent1.xaml"));
            ThemeManager.AddAccent("CustomAccent2", new Uri("pack://application:,,,/SpaSolutions;component/CustomAccents/CustomAccent2.xaml"));
            ThemeManager.AddAppTheme("CustomTheme", new Uri("pack://application:,,,/SpaSolutions;component/CustomAccents/CustomTheme.xaml"));

            // create custom accents
            ThemeManagerHelper.CreateAppStyleBy(Colors.Red);
            ThemeManagerHelper.CreateAppStyleBy(Colors.GreenYellow);
            ThemeManagerHelper.CreateAppStyleBy(Colors.Indigo, true);
            var window = new MainWindow()
            {
                DataContext = MainWindowViewModel.Instance
            };

            window.Show();
        }
Exemplo n.º 9
0
        protected override void OnStartup(StartupEventArgs e)
        {
            // add custom accent and theme resource dictionaries
            //            ThemeManager.AddAccent("CustomAccent1", new Uri("pack://application:,,,/MahAppsMetroThemesSample;component/CustomAccents/CustomAccent1.xaml"));
            //            ThemeManager.AddAccent("CustomAccent2", new Uri("pack://application:,,,/MahAppsMetroThemesSample;component/CustomAccents/CustomAccent2.xaml"));
            //            ThemeManager.AddAppTheme("CustomTheme", new Uri("pack://application:,,,/MahAppsMetroThemesSample;component/CustomAccents/CustomTheme.xaml"));

            base.OnStartup(e);

            ThemeManager.IsAutomaticWindowsAppModeSettingSyncEnabled = true;
            ThemeManager.SyncThemeWithWindowsAppModeSetting();

            // create custom accents
            ThemeManagerHelper.CreateTheme("Dark", Colors.Red, "CustomAccentDarkRed");
            ThemeManagerHelper.CreateTheme("Light", Colors.Red, "CustomAccentLightRed");
            ThemeManagerHelper.CreateTheme("Dark", Colors.GreenYellow);
            ThemeManagerHelper.CreateTheme("Light", Colors.GreenYellow);
            ThemeManagerHelper.CreateTheme("Dark", Colors.Indigo);
            ThemeManagerHelper.CreateTheme("Light", Colors.Indigo, changeImmediately: true);
        }
Exemplo n.º 10
0
        public MainWindow()
        {
            InitializeComponent();
            IAppSettingsBase          appSettingsBase          = new AppSettingsBase(Settings.Default);
            IApplicationStyleSettings applicationStyleSettings = new ApplicationStyleSettings(appSettingsBase);
            IThemeManagerHelper       themeManagerHelper       = new ThemeManagerHelper();

            _applicationStyle = new ApplicationStyle(this, Accent, ThemeSwitch, applicationStyleSettings, themeManagerHelper);
            _applicationStyle.Load(true);

            _rotateDisplay         = new RotateDisplay();
            _rotateButtonAndCanvas = new RotateButtonAndCanvas();
            Load();
            var linkerTime = Assembly.GetExecutingAssembly().GetLinkerTime();

            LinkerTime.Content = linkerTime.ToString(CultureInfo.InvariantCulture);

            Application.Current.Exit += CurrentExit;
            _overrideProtection       = 1;
            ConfigureAutoRun();
        }
Exemplo n.º 11
0
        // ReSharper restore PrivateFieldCanBeConvertedToLocalVariable

        /// <summary>
        ///     MainWindows.
        ///     Gets a new movie list instance.
        /// </summary>
        public MainWindow()
        {
            _appBasic = new AppBasic(this);

            _xmlSettings = new XmlSettings();
            _xmlDatabase = new XmlDatabase(_xmlSettings);
            _movies      = new Movies(_xmlDatabase);
            IAppSettingsBase appSettingsBase = new AppSettingsBase(Settings.Default);

            _coreSettings = new ApplicationStyleSettings(appSettingsBase);
            InitializeComponent();
            var themeManagerHelper = new ThemeManagerHelper();

            _style = new ApplicationStyle(this, Accent, ThemeSwitch, _coreSettings, themeManagerHelper);
            _style.Load(true, true);
            _dialogService = new DialogService(this);
            _addEdit       = new AddEdit(this, _movies, _dialogService);
            ValidateSettings();
            var linkerTime = Assembly.GetExecutingAssembly().GetLinkerTime();

            LinkerTime.Content = linkerTime.ToString(CultureInfo.InvariantCulture);
            _appBasic.SetComboBoxItems();
        }
Exemplo n.º 12
0
        public MainWindow()
        {
            ThemeManagerHelper.CreateAppStyleBy(Brushes.Brown.Color, true);

            InitializeComponent();
        }
Exemplo n.º 13
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new ViewModel.MainWindowViewModel();
     ThemeManagerHelper.CreateAppStyleBy(Color.FromArgb(255, 45, 45, 48), true, true);
 }