Esempio n. 1
0
        /// <summary>
        /// Applies the current theme to the <see cref="Control"/>.
        /// </summary>
        /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
        public void ApplyTheme(BaseTheme theme)
        {
            tsbAddFilter.Image    = theme.Resources.Images["FrmFilterTbAdd"];
            tsbEditFilter.Image   = theme.Resources.Images["FrmFilterTbEdit"];
            tsbRemoveFilter.Image = theme.Resources.Images["FrmFilterTbRemove"];
            tsbZoomIn.Image       = theme.Resources.Images["FrmMainTbZoomIn"];
            tsbZoomOut.Image      = theme.Resources.Images["FrmMainTbZoomOut"];

            dgvFilter.EnableHeadersVisualStyles             = theme.Metrics.PreferSystemRendering;
            dgvFilter.ColumnHeadersDefaultCellStyle.Padding = theme.Metrics.DataGridViewHeaderColumnPadding;

            dgvFilter.BackgroundColor          = theme.ColorPalette.ContentBackground;
            dgvFilter.ForeColor                = theme.ColorPalette.ContentForeground;
            dgvFilter.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
            dgvFilter.GridColor                = theme.ColorPalette.DividerColor;

            dgvFilter.ColumnHeadersDefaultCellStyle.BackColor = theme.ColorPalette.ContentBackground;
            dgvFilter.ColumnHeadersDefaultCellStyle.ForeColor = theme.ColorPalette.ContentForeground;

            dgvFilter.CellBorderStyle            = DataGridViewCellBorderStyle.Single;
            dgvFilter.DefaultCellStyle.BackColor = theme.ColorPalette.ContentBackground;
            dgvFilter.DefaultCellStyle.ForeColor = theme.ColorPalette.ContentForeground;
        }
        /// <summary>
        /// Applies the current theme to the <see cref="Control"/>.
        /// </summary>
        /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
        public void ApplyTheme(BaseTheme theme)
        {
            tsbRemoveBookmark.Image   = theme.Resources.Images["FrmBookmarksTbRemove"];
            tsbPreviousBookmark.Image = theme.Resources.Images["FrmBookmarksTbPrevious"];
            tsbNextBookmark.Image     = theme.Resources.Images["FrmBookmarksTbNext"];
            tsbZoomIn.Image           = theme.Resources.Images["FrmMainTbZoomIn"];
            tsbZoomOut.Image          = theme.Resources.Images["FrmMainTbZoomOut"];

            dgvBookmarks.EnableHeadersVisualStyles             = theme.Metrics.PreferSystemRendering;
            dgvBookmarks.ColumnHeadersDefaultCellStyle.Padding = theme.Metrics.DataGridViewHeaderColumnPadding;

            dgvBookmarks.BackgroundColor          = theme.ColorPalette.ContentBackground;
            dgvBookmarks.ForeColor                = theme.ColorPalette.ContentForeground;
            dgvBookmarks.ColumnHeadersBorderStyle = DataGridViewHeaderBorderStyle.Single;
            dgvBookmarks.GridColor                = theme.ColorPalette.DividerColor;

            dgvBookmarks.ColumnHeadersDefaultCellStyle.BackColor = theme.ColorPalette.ContentBackground;
            dgvBookmarks.ColumnHeadersDefaultCellStyle.ForeColor = theme.ColorPalette.ContentForeground;

            dgvBookmarks.CellBorderStyle            = DataGridViewCellBorderStyle.Single;
            dgvBookmarks.DefaultCellStyle.BackColor = theme.ColorPalette.ContentBackground;
            dgvBookmarks.DefaultCellStyle.ForeColor = theme.ColorPalette.ContentForeground;
        }
Esempio n. 3
0
        /// <summary>
        /// Applies the current theme to the <see cref="Control"/>.
        /// </summary>
        /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
        public void ApplyTheme(BaseTheme theme)
        {
            tsbZoomIn.Image  = theme.Resources.Images["FrmMainTbZoomIn"];
            tsbZoomOut.Image = theme.Resources.Images["FrmMainTbZoomOut"];
            tsbCopy.Image    = theme.Resources.Images["FrmScriptTbCopy"];

            LogMessagePanel.BackColor = theme.ColorPalette.ContentBackground;
            LogMessagePanel.ForeColor = theme.ColorPalette.ContentForeground;

            if (Gui.Helper.OSHelper.IsWinVista && !string.IsNullOrEmpty(theme.WindowThemeName))
            {
                Gui.Interop.Win32.SetWindowTheme(LogMessagePanel.Handle, theme.WindowThemeName, null);
            }

            foreach (Control ctrl in tblLogMessage.Controls)
            {
                if (ctrl is TextBox textBoxControl)
                {
                    textBoxControl.BackColor = theme.ColorPalette.ContentBackground;
                    textBoxControl.ForeColor = theme.ColorPalette.ContentForeground;
                }
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Applies the current theme to the <see cref="Control"/>.
        /// </summary>
        /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
        public void ApplyTheme(BaseTheme theme)
        {
            tsbZoomIn.Image  = theme.Resources.Images["FrmMainTbZoomIn"];
            tsbZoomOut.Image = theme.Resources.Images["FrmMainTbZoomOut"];
            tsbCopy.Image    = theme.Resources.Images["FrmScriptTbCopy"];

            pbxCopyNumber.Image           = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopySeverity.Image         = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyLocalMachineTime.Image = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyTime.Image             = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyFacility.Image         = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopySender.Image           = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyMessage.Image          = theme.Resources.Images["FrmScriptTbCopy"];

            LogMessagePanel.BackColor = theme.ColorPalette.ContentBackground;
            LogMessagePanel.ForeColor = theme.ColorPalette.ContentForeground;

            txtDataNumber.BackColor           = theme.ColorPalette.ContentBackground;
            txtDataNumber.ForeColor           = theme.ColorPalette.ContentForeground;
            txtDataSeverity.BackColor         = theme.ColorPalette.ContentBackground;
            txtDataSeverity.ForeColor         = theme.ColorPalette.ContentForeground;
            txtDataLocalMachineTime.BackColor = theme.ColorPalette.ContentBackground;
            txtDataLocalMachineTime.ForeColor = theme.ColorPalette.ContentForeground;
            txtDataTime.BackColor             = theme.ColorPalette.ContentBackground;
            txtDataTime.ForeColor             = theme.ColorPalette.ContentForeground;
            txtDataFacility.BackColor         = theme.ColorPalette.ContentBackground;
            txtDataFacility.ForeColor         = theme.ColorPalette.ContentForeground;
            txtDataSender.BackColor           = theme.ColorPalette.ContentBackground;
            txtDataSender.ForeColor           = theme.ColorPalette.ContentForeground;
            txtDataMessage.BackColor          = theme.ColorPalette.ContentBackground;
            txtDataMessage.ForeColor          = theme.ColorPalette.ContentForeground;

            if (Gui.Helper.OSHelper.IsWinVista && !string.IsNullOrEmpty(theme.WindowThemeName))
            {
                Gui.Interop.Win32.SetWindowTheme(LogMessagePanel.Handle, theme.WindowThemeName, null);
            }
        }
Esempio n. 5
0
        /// <summary>
        /// Applies the current theme to the <see cref="Control"/>.
        /// </summary>
        /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
        public void ApplyTheme(BaseTheme theme)
        {
            tsbZoomIn.Image  = theme.Resources.Images["FrmMainTbZoomIn"];
            tsbZoomOut.Image = theme.Resources.Images["FrmMainTbZoomOut"];
            tsbCopy.Image    = theme.Resources.Images["FrmScriptTbCopy"];

            pbxCopyLogger.Image     = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyLevel.Image      = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyThread.Image     = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyDateTime.Image   = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyMessage.Image    = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyLocation.Image   = theme.Resources.Images["FrmScriptTbCopy"];
            pbxCopyProperties.Image = theme.Resources.Images["FrmScriptTbCopy"];

            LogMessagePanel.BackColor = theme.ColorPalette.ContentBackground;
            LogMessagePanel.ForeColor = theme.ColorPalette.ContentForeground;

            txtDataLogger.BackColor     = theme.ColorPalette.ContentBackground;
            txtDataLogger.ForeColor     = theme.ColorPalette.ContentForeground;
            txtDataLevel.BackColor      = theme.ColorPalette.ContentBackground;
            txtDataLevel.ForeColor      = theme.ColorPalette.ContentForeground;
            txtDataDateTime.BackColor   = theme.ColorPalette.ContentBackground;
            txtDataDateTime.ForeColor   = theme.ColorPalette.ContentForeground;
            txtDataThread.BackColor     = theme.ColorPalette.ContentBackground;
            txtDataThread.ForeColor     = theme.ColorPalette.ContentForeground;
            txtDataMessage.BackColor    = theme.ColorPalette.ContentBackground;
            txtDataMessage.ForeColor    = theme.ColorPalette.ContentForeground;
            txtDataLocation.BackColor   = theme.ColorPalette.ContentBackground;
            txtDataLocation.ForeColor   = theme.ColorPalette.ContentForeground;
            txtDataProperties.BackColor = theme.ColorPalette.ContentBackground;
            txtDataProperties.ForeColor = theme.ColorPalette.ContentForeground;

            if (Gui.Helper.OSHelper.IsWinVista && !string.IsNullOrEmpty(theme.WindowThemeName))
            {
                Gui.Interop.Win32.SetWindowTheme(LogMessagePanel.Handle, theme.WindowThemeName, null);
            }
        }
Esempio n. 6
0
        public async Task DialogBackgroundShouldInheritThemeBackground(BaseTheme dialogTheme)
        {
            await using var recorder = new TestRecorder(App);

            IVisualElement grid = await LoadXaml <Grid>($@"
<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition />
    <ColumnDefinition />
  </Grid.ColumnDefinitions>

  <materialDesign:DialogHost DialogTheme=""{dialogTheme}"" x:Name=""DialogHost1"">
    <materialDesign:DialogHost.DialogContent>
      <TextBlock Text=""Some Text"" x:Name=""TextBlock1"" Margin=""50"" />
    </materialDesign:DialogHost.DialogContent>
    <Button Content=""Show Dialog"" x:Name=""ShowButton1"" Command=""{{x:Static materialDesign:DialogHost.OpenDialogCommand}}"" />
  </materialDesign:DialogHost>

  <materialDesign:DialogHost Style=""{{StaticResource MaterialDesignEmbeddedDialogHost}}"" DialogTheme=""{dialogTheme}"" x:Name=""DialogHost2"" Grid.Column=""1"">
    <materialDesign:DialogHost.DialogContent>
      <TextBlock Text=""Some Text"" x:Name=""TextBlock2"" Margin=""50"" />
    </materialDesign:DialogHost.DialogContent>
    <Button Content=""Show Dialog"" x:Name=""ShowButton2"" Command=""{{x:Static materialDesign:DialogHost.OpenDialogCommand}}"" />
  </materialDesign:DialogHost>

</Grid>");

            var showButton1 = await grid.GetElement <Button>("ShowButton1");

            var showButton2 = await grid.GetElement <Button>("ShowButton2");

            await showButton1.LeftClick();

            await showButton2.LeftClick();

            var dialogHost1 = await grid.GetElement <DialogHost>("DialogHost1");

            var dialogHost2 = await grid.GetElement <DialogHost>("DialogHost2");

            var card1 = await Wait.For(async() => await dialogHost1.GetElement <Card>("PART_PopupContentElement"));

            var card2 = await Wait.For(async() => await dialogHost2.GetElement <Card>("PART_PopupContentElement"));

            IResource paperResource1 = await card1.GetResource("MaterialDesignPaper");

            var paperBrush1 = paperResource1.GetAs <SolidColorBrush>();

            Assert.NotNull(paperBrush1);
            paperBrush1 !.Freeze();
            IResource paperResource2 = await card1.GetResource("MaterialDesignPaper");

            var paperBrush2 = paperResource2.GetAs <SolidColorBrush>();

            Assert.NotNull(paperBrush2);
            paperBrush2 !.Freeze();

            Assert.Equal(paperBrush1.Color, await card1.GetBackgroundColor());
            Assert.Equal(paperBrush2.Color, await card2.GetBackgroundColor());

            var textBlock1 = await dialogHost1.GetElement <TextBlock>("TextBlock1");

            var textBlock2 = await dialogHost2.GetElement <TextBlock>("TextBlock2");

            await Wait.For(async() =>
            {
                Color?foreground1 = await textBlock1.GetForegroundColor();
                Assert.NotNull(foreground1);
                AssertContrastRatio(
                    foreground1.Value,
                    await textBlock1.GetEffectiveBackground(),
                    MinimumContrastSmallText);
            });

            await Wait.For(async() =>
            {
                Color?foreground2 = await textBlock2.GetForegroundColor();
                Assert.NotNull(foreground2);
                AssertContrastRatio(
                    foreground2.Value,
                    await textBlock2.GetEffectiveBackground(),
                    MinimumContrastSmallText);
            });

            recorder.Success();
        }
Esempio n. 7
0
 /// <summary>
 /// Applies the current theme to the <see cref="Control"/>.
 /// </summary>
 /// <param name="theme">The <see cref="BaseTheme"/> instance to apply.</param>
 public void ApplyTheme(BaseTheme theme)
 {
     BackColor = theme.ColorPalette.ContentBackground;
 }
Esempio n. 8
0
 protected override ITheme GetTheme()
 {
     return(Theme.Create(BaseTheme.GetBaseTheme(), Primary, Accent));
 }
Esempio n. 9
0
 protected override ITheme GetTheme()
 {
     return(Theme.Create(BaseTheme.GetBaseTheme(),
                         SwatchHelper.Lookup[(MaterialDesignColor)PrimaryColor],
                         SwatchHelper.Lookup[(MaterialDesignColor)AccentColor]));
 }
        public static void SetMahApps(this ResourceDictionary resourceDictionary, ITheme theme, BaseTheme baseTheme)
        {
            resourceDictionary.SetMahAppsBaseTheme(baseTheme);

            resourceDictionary.SetBrush("HighlightBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentBaseColorBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentColorBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentColorBrush2", theme.PrimaryMid.Color, 0.8);
            resourceDictionary.SetBrush("AccentColorBrush3", theme.PrimaryLight.Color);
            resourceDictionary.SetBrush("AccentColorBrush4", theme.PrimaryLight.Color, 0.8);
            resourceDictionary.SetBrush("WindowTitleColorBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentSelectedColorBrush", theme.PrimaryMid.GetForegroundColor());
            resourceDictionary.SetBrush("ProgressBrush", new LinearGradientBrush(theme.PrimaryDark.Color, theme.PrimaryMid.Color, 90.0));
            resourceDictionary.SetBrush("CheckmarkFill", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("RightArrowFill", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("IdealForegroundColorBrush", theme.PrimaryMid.GetForegroundColor());
            resourceDictionary.SetBrush("IdealForegroundDisabledBrush", theme.PrimaryDark.GetForegroundColor(), 0.4);

            resourceDictionary.SetBrush("MetroDataGrid.HighlightBrush", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("MetroDataGrid.HighlightTextBrush", theme.PrimaryMid.GetForegroundColor());
            resourceDictionary.SetBrush("MetroDataGrid.MouseOverHighlightBrush", theme.PrimaryLight.Color);
            resourceDictionary.SetBrush("MetroDataGrid.FocusBorderBrush", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("MetroDataGrid.InactiveSelectionHighlightBrush", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("MetroDataGrid.InactiveSelectionHighlightTextBrush", theme.PrimaryMid.GetForegroundColor());

            resourceDictionary.SetBrush("MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchBrush.Win10", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchMouseOverBrush.Win10", theme.PrimaryMid.Color, 0.8);
            resourceDictionary.SetBrush("MahApps.Metro.Brushes.ToggleSwitchButton.ThumbIndicatorCheckedBrush.Win10", theme.PrimaryMid.GetForegroundColor(), 0.8);
        }
Esempio n. 11
0
 public static void ChangeBaseTheme(BaseTheme x)
 {
     (App.Current.Resources.MergedDictionaries[0] as CustomColorTheme).BaseTheme = x;
     //(App.Current.Resources.MergedDictionaries[0] as CustomColorTheme).PrimaryColor = System.Windows.Media.Color.FromRgb(00,200,255);
 }
        internal static void SetMahAppsBaseTheme(this ResourceDictionary resourceDictionary, BaseTheme baseTheme)
        {
            if (resourceDictionary == null)
            {
                throw new ArgumentNullException(nameof(resourceDictionary));
            }

            var existingMahAppsResourceDictionary = resourceDictionary.MergedDictionaries
                                                    .Where(rd => rd.Source != null)
                                                    .SingleOrDefault(rd => Regex.Match(rd.Source.OriginalString, @"(\/MahApps.Metro;component\/Styles\/Accents\/)((BaseLight)|(BaseDark))").Success);

            if (existingMahAppsResourceDictionary != null)
            {
                resourceDictionary.MergedDictionaries.Remove(existingMahAppsResourceDictionary);
            }

            var source = $"pack://application:,,,/MahApps.Metro;component/Styles/Accents/{(baseTheme == BaseTheme.Dark ? "BaseDark" : "BaseLight")}.xaml";
            var newMahAppsResourceDictionary = new ResourceDictionary {
                Source = new Uri(source)
            };

            resourceDictionary.MergedDictionaries.Add(newMahAppsResourceDictionary);
        }
        public static void SetMahApps(this ResourceDictionary resourceDictionary, ITheme theme, BaseTheme baseTheme)
        {
            resourceDictionary.SetMahAppsBaseTheme(baseTheme);

            resourceDictionary.SetBrush("HighlightBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentColorBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentColorBrush2", theme.PrimaryMid.Color);
            resourceDictionary.SetBrush("AccentColorBrush3", theme.PrimaryLight.Color);
            resourceDictionary.SetBrush("AccentColorBrush4", theme.PrimaryLight.Color, 0.82);
            resourceDictionary.SetBrush("WindowTitleColorBrush", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("AccentSelectedColorBrush", theme.PrimaryDark.GetForegroundColor());
            resourceDictionary.SetBrush("ProgressBrush", new LinearGradientBrush(theme.PrimaryDark.Color, theme.PrimaryMid.Color, 90.0));
            resourceDictionary.SetBrush("CheckmarkFill", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("RightArrowFill", theme.PrimaryDark.Color);
            resourceDictionary.SetBrush("IdealForegroundColorBrush", theme.PrimaryDark.GetForegroundColor());
            resourceDictionary.SetBrush("IdealForegroundDisabledBrush", theme.PrimaryDark.GetForegroundColor(), 0.4);
        }
 protected override ITheme GetTheme()
 {
     return(Theme.Create(BaseTheme.GetBaseTheme(), Primary, Secondary));
 }
Esempio n. 15
0
        public static void SetMahApps(this ResourceDictionary resourceDictionary, ITheme theme, BaseTheme baseTheme)
        {
            resourceDictionary.SetMahAppsBaseTheme(baseTheme);

            resourceDictionary.SetBrush("Theme.ShowcaseBrush", new SolidColorBrush(theme.SecondaryMid.Color));

            resourceDictionary.SetColor("MahApps.Colors.HighlightLight", theme.PrimaryLight.Color);
            resourceDictionary.SetColor("MahApps.Colors.Highlight", theme.PrimaryMid.Color);
            resourceDictionary.SetColor("MahApps.Colors.HighlightDark", theme.PrimaryDark.Color);
            resourceDictionary.SetColor("MahApps.Colors.AccentBase", theme.SecondaryDark.Color);
            resourceDictionary.SetColor("MahApps.Colors.Accent", theme.SecondaryMid.Color);
            resourceDictionary.SetColor("MahApps.Colors.Accent2", theme.SecondaryMid.Color);
            resourceDictionary.SetColor("MahApps.Colors.Accent3", theme.SecondaryLight.Color);
            resourceDictionary.SetColor("MahApps.Colors.Accent4", theme.SecondaryLight.Color);

            resourceDictionary.SetColor("MahApps.Colors.ProgressIndeterminate1", Color.FromArgb(0x33, 0x87, 0x87, 0x87));
            resourceDictionary.SetColor("MahApps.Colors.ProgressIndeterminate2", Color.FromArgb(0x33, 0x95, 0x95, 0x95));
            resourceDictionary.SetColor("MahApps.Colors.ProgressIndeterminate3", Color.FromArgb(0x4C, 0x00, 0x00, 0x00));
            resourceDictionary.SetColor("MahApps.Colors.ProgressIndeterminate4", Color.FromArgb(0x4C, 0x00, 0x00, 0x00));

            resourceDictionary.SetBrush("MahApps.Brushes.Control.Background", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.White", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Black", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Text", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Label.Text", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.WhiteColor", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.BlackColor", (Color)resourceDictionary["MahApps.Colors.Black"]);

            resourceDictionary.SetBrush("MahApps.Brushes.WindowTitle", (Color)resourceDictionary["MahApps.Colors.HighlightDark"]);
            resourceDictionary.SetBrush("MahApps.Brushes.WindowTitle.NonActive", Color.FromRgb(0x80, 0x80, 0x80));
            resourceDictionary.SetBrush("MahApps.Brushes.Border.NonActive", Color.FromRgb(0x80, 0x80, 0x80));

            resourceDictionary.SetBrush("MahApps.Brushes.Highlight", (Color)resourceDictionary["MahApps.Colors.Highlight"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DisabledWhite", (Color)resourceDictionary["MahApps.Colors.White"]);

            resourceDictionary.SetBrush("MahApps.Brushes.TransparentWhite", Color.FromArgb(0x00, 0xFF, 0xFF, 0xFF));
            resourceDictionary.SetBrush("MahApps.Brushes.SemiTransparentWhite", Color.FromArgb(0x55, 0xFF, 0xFF, 0xFF));
            resourceDictionary.SetBrush("MahApps.Brushes.SemiTransparentGray", Color.FromArgb(0x40, 0x80, 0x80, 0x80));
            resourceDictionary.SetBrush("MahApps.Brushes.Controls.Disabled", Color.FromArgb(0xA5, 0xFF, 0xFF, 0xFF));

            resourceDictionary.SetBrush("MahApps.Brushes.AccentBase", (Color)resourceDictionary["MahApps.Colors.AccentBase"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Accent", (Color)resourceDictionary["MahApps.Colors.Accent"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Accent2", (Color)resourceDictionary["MahApps.Colors.Accent2"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Accent3", (Color)resourceDictionary["MahApps.Colors.Accent3"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Accent4", (Color)resourceDictionary["MahApps.Colors.Accent4"]);

            resourceDictionary.SetBrush("MahApps.Brushes.Gray1", (Color)resourceDictionary["MahApps.Colors.Gray1"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray2", (Color)resourceDictionary["MahApps.Colors.Gray2"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray3", (Color)resourceDictionary["MahApps.Colors.Gray3"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray4", (Color)resourceDictionary["MahApps.Colors.Gray4"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray5", (Color)resourceDictionary["MahApps.Colors.Gray5"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray6", (Color)resourceDictionary["MahApps.Colors.Gray6"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray7", (Color)resourceDictionary["MahApps.Colors.Gray7"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray8", (Color)resourceDictionary["MahApps.Colors.Gray8"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray9", (Color)resourceDictionary["MahApps.Colors.Gray9"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Gray10", (Color)resourceDictionary["MahApps.Colors.Gray10"]);

            resourceDictionary.SetBrush("MahApps.Brushes.GrayNormal", (Color)resourceDictionary["MahApps.Colors.GrayNormal"]);
            resourceDictionary.SetBrush("MahApps.Brushes.GrayHover", (Color)resourceDictionary["MahApps.Colors.GrayHover"]);

            resourceDictionary.SetBrush("MahApps.Brushes.Controls.Border", (Color)resourceDictionary["MahApps.Colors.Gray6"]);
            resourceDictionary.SetBrush("MahApps.Brushes.TextBox.Border", theme.TextBoxBorder);
            resourceDictionary.SetBrush("MahApps.Brushes.TextBox.MouseOverInnerBorder", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.TextBox.FocusBorder", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.TextBox.MouseOverBorder", theme.PrimaryMid.Color);

            resourceDictionary.SetBrush("MahApps.Brushes.Button.MouseOverBorder", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Button.MouseOverInnerBorder", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ComboBox.MouseOverBorder", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ComboBox.MouseOverInnerBorder", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ComboBox.PopupBorder", (Color)resourceDictionary["MahApps.Colors.Gray4"]);

            resourceDictionary.SetBrush("MahApps.Brushes.CheckBox", (Color)resourceDictionary["MahApps.Colors.Gray6"]);
            resourceDictionary.SetBrush("MahApps.Brushes.CheckBox.MouseOver", (Color)resourceDictionary["MahApps.Colors.Gray2"]);

            resourceDictionary.SetBrush("MahApps.Brushes.CheckBox.Background", new LinearGradientBrush {
                StartPoint    = new Point(0.5, 0),
                EndPoint      = new Point(0.5, 1),
                GradientStops = new GradientStopCollection
                {
                    new GradientStop((Color)resourceDictionary["MahApps.Colors.Gray7"], 0),
                    new GradientStop((Color)resourceDictionary["MahApps.Colors.White"], 1)
                }
            });
            resourceDictionary.SetBrush("MahApps.Brushes.Thumb", (Color)resourceDictionary["MahApps.Colors.Gray5"]);

            resourceDictionary.SetBrush("MahApps.Brushes.Progress", new LinearGradientBrush {
                StartPoint    = new Point(1.002, 0.5),
                EndPoint      = new Point(0.001, 0.5),
                GradientStops = new GradientStopCollection
                {
                    new GradientStop((Color)resourceDictionary["MahApps.Colors.Highlight"], 0),
                    new GradientStop((Color)resourceDictionary["MahApps.Colors.Accent3"], 1)
                }
            });
            resourceDictionary.SetBrush("MahApps.Brushes.SliderValue.Disabled", (Color)resourceDictionary["MahApps.Colors.SliderValue.Disabled"]);
            resourceDictionary.SetBrush("MahApps.Brushes.SliderTrack.Disabled", (Color)resourceDictionary["MahApps.Colors.SliderTrack.Disabled"]);
            resourceDictionary.SetBrush("MahApps.Brushes.SliderThumb.Disabled", (Color)resourceDictionary["MahApps.Colors.SliderThumb.Disabled"]);
            resourceDictionary.SetBrush("MahApps.Brushes.SliderTrack.Hover", (Color)resourceDictionary["MahApps.Colors.SliderTrack.Hover"]);
            resourceDictionary.SetBrush("MahApps.Brushes.SliderTrack.Normal", (Color)resourceDictionary["MahApps.Colors.SliderTrack.Normal"]);

            resourceDictionary.SetBrush("MahApps.Brushes.Flyout.Background", (Color)resourceDictionary["MahApps.Colors.Flyout"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Flyout.Foreground", (Color)resourceDictionary["MahApps.Colors.Black"]);

            resourceDictionary.SetBrush("MahApps.Brushes.Window.FlyoutOverlay", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Window.Background", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.Separator", Color.FromArgb(0xFF, 0xC4, 0xC4, 0xC5));

            resourceDictionary.SetBrush("MahApps.Brushes.FlatButton.Background", Color.FromRgb(0xD5, 0xD5, 0xD5));
            resourceDictionary.SetBrush("MahApps.Brushes.FlatButton.Foreground", Color.FromRgb(0x22, 0x22, 0x22));
            resourceDictionary.SetBrush("MahApps.Brushes.FlatButton.PressedBackground", (Color)resourceDictionary["MahApps.Colors.FlatButton.PressedBackground"]);
            resourceDictionary.SetBrush("MahApps.Brushes.FlatButton.PressedForeground", Colors.White);

            resourceDictionary.SetBrush("MahApps.Brushes.DarkIdealForegroundDisabled", Color.FromRgb(0xAD, 0xAD, 0xAD));
            resourceDictionary.SetBrush("MahApps.Brushes.CleanWindowCloseButton.Background", Color.FromRgb(0xEB, 0x2F, 0x2F));
            resourceDictionary.SetBrush("MahApps.Brushes.CleanWindowCloseButton.PressedBackground", Color.FromRgb(0x7C, 0x00, 0x00));

            //CONTROL VALIDATION BRUSHES
            resourceDictionary.SetBrush("MahApps.Brushes.Controls.Validation", Color.FromArgb(0xFF, 0xDB, 0x00, 0x0C));
            resourceDictionary.SetBrush("MahApps.Brushes.Validation1", Color.FromArgb(0x05, 0x2A, 0x2E, 0x31));
            resourceDictionary.SetBrush("MahApps.Brushes.Validation2", Color.FromArgb(0x15, 0x2A, 0x2E, 0x31));
            resourceDictionary.SetBrush("MahApps.Brushes.Validation3", Color.FromArgb(0x25, 0x2A, 0x2E, 0x31));
            resourceDictionary.SetBrush("MahApps.Brushes.Validation4", Color.FromArgb(0x35, 0x2A, 0x2E, 0x31));
            resourceDictionary.SetBrush("MahApps.Brushes.Validation5", Color.FromArgb(0xFF, 0xDC, 0x00, 0x0C));
            //unused
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummary1", Color.FromArgb(0xFF, 0xDC, 0x02, 0x0D));
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummary2", Color.FromArgb(0xFF, 0xCA, 0x00, 0x0C));
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummary3", Color.FromArgb(0xFF, 0xFF, 0x92, 0x98));
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummary4", Color.FromArgb(0xFF, 0xFD, 0xC8, 0xC8));
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummary5", Color.FromArgb(0xDD, 0xD4, 0x39, 0x40));
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummaryFill1", Color.FromArgb(0x59, 0xF7, 0xD8, 0xDB));
            resourceDictionary.SetBrush("MahApps.Brushes.ValidationSummaryFill2", Color.FromArgb(0xFF, 0xF7, 0xD8, 0xDB));
            //validation text foreground always white
            resourceDictionary.SetBrush("MahApps.Brushes.Text.Validation", Colors.White);

            //WPF default colors
            resourceDictionary.SetBrush("{x:Static SystemColors.WindowBrushKey}", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("{x:Static SystemColors.ControlTextBrushKey}", (Color)resourceDictionary["MahApps.Colors.Black"]);

            //menu default colors
            resourceDictionary.SetBrush("MahApps.Brushes.Menu.Background", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ContextMenu.Background", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.SubMenu.Background", (Color)resourceDictionary["MahApps.Colors.White"]);
            resourceDictionary.SetBrush("MahApps.Brushes.MenuItem.Background", (Color)resourceDictionary["MahApps.Colors.White"]);

            resourceDictionary.SetBrush("MahApps.Brushes.ContextMenu.Border", (Color)resourceDictionary["MahApps.Colors.Black"]);
            resourceDictionary.SetBrush("MahApps.Brushes.SubMenu.Border", (Color)resourceDictionary["MahApps.Colors.Black"]);

            resourceDictionary.SetBrush("MahApps.Brushes.MenuItem.SelectionFill", (Color)resourceDictionary["MahApps.Colors.MenuItem.SelectionFill"]);
            resourceDictionary.SetBrush("MahApps.Brushes.MenuItem.SelectionStroke", (Color)resourceDictionary["MahApps.Colors.MenuItem.SelectionStroke"]);

            resourceDictionary.SetBrush("MahApps.Brushes.TopMenuItem.PressedFill", (Color)resourceDictionary["MahApps.Colors.TopMenuItem.PressedFill"]);
            resourceDictionary.SetBrush("MahApps.Brushes.TopMenuItem.PressedStroke", (Color)resourceDictionary["MahApps.Colors.TopMenuItem.PressedStroke"]);
            resourceDictionary.SetBrush("MahApps.Brushes.TopMenuItem.SelectionStroke", (Color)resourceDictionary["MahApps.Colors.TopMenuItem.SelectionStroke"]);

            resourceDictionary.SetBrush("MahApps.Brushes.MenuItem.DisabledForeground", (Color)resourceDictionary["MahApps.Colors.MenuItem.DisabledForeground"]);
            resourceDictionary.SetBrush("MahApps.Brushes.MenuItem.DisabledGlyphPanel", Color.FromRgb(0x84, 0x85, 0x89));

            resourceDictionary.SetBrush("{x:Static SystemColors.MenuTextBrushKey}", (Color)resourceDictionary["MahApps.Colors.Black"]);

            resourceDictionary.SetBrush("MahApps.Brushes.CheckmarkFill", (Color)resourceDictionary["MahApps.Colors.Accent"]);
            resourceDictionary.SetBrush("MahApps.Brushes.RightArrowFill", (Color)resourceDictionary["MahApps.Colors.Accent"]);

            resourceDictionary.SetColor("MahApps.Colors.IdealForeground", theme.PrimaryMid.GetForegroundColor());
            resourceDictionary.SetBrush("MahApps.Brushes.IdealForeground", theme.PrimaryMid.GetForegroundColor());
            resourceDictionary.SetBrush("MahApps.Brushes.IdealForegroundDisabled", (Color)resourceDictionary["MahApps.Colors.IdealForeground"]);
            resourceDictionary.SetBrush("MahApps.Brushes.AccentSelectedColor", (Color)resourceDictionary["MahApps.Colors.IdealForeground"]);

            //DataGrid brushes

            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.Highlight", (Color)resourceDictionary["MahApps.Colors.Accent"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.DisabledHighlight", (Color)resourceDictionary["MahApps.Colors.Gray7"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.HighlightText", (Color)resourceDictionary["MahApps.Colors.IdealForeground"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.MouseOverHighlight", (Color)resourceDictionary["MahApps.Colors.Accent3"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.FocusBorder", (Color)resourceDictionary["MahApps.Colors.Accent"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.InactiveSelectionHighlight", (Color)resourceDictionary["MahApps.Colors.Accent2"]);
            resourceDictionary.SetBrush("MahApps.Brushes.DataGrid.InactiveSelectionHighlightText", (Color)resourceDictionary["MahApps.Colors.IdealForeground"]);

            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.Pressed.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.Pressed.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OffBorder.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.OffBorder.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OffMouseOverBorder.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.OffMouseOverBorder.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OffDisabledBorder.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.OffDisabledBorder.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OffSwitch.Win10", Colors.Transparent);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OnSwitch.Win10", (Color)resourceDictionary["MahApps.Colors.Accent"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OnSwitchDisabled.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.OnSwitchDisabled.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.OnSwitchMouseOver.Win10", (Color)resourceDictionary["MahApps.Colors.Accent2"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.ThumbIndicator.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.ThumbIndicator.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.ThumbIndicatorMouseOver.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.ThumbIndicatorMouseOver.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.ThumbIndicatorChecked.Win10", (Color)resourceDictionary["MahApps.Colors.IdealForeground"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.ThumbIndicatorPressed.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.ThumbIndicatorPressed.Win10"]);
            resourceDictionary.SetBrush("MahApps.Brushes.ToggleSwitchButton.ThumbIndicatorDisabled.Win10", (Color)resourceDictionary["MahApps.Colors.ToggleSwitchButton.ThumbIndicatorDisabled.Win10"]);

            resourceDictionary.SetBrush("MahApps.Brushes.Badged.DisabledBackground", (Color)resourceDictionary["MahApps.Colors.Badged.DisabledBackground"]);

            //HamburgerMenu

            resourceDictionary.SetBrush("MahApps.HamburgerMenu.PaneBackground", Color.FromArgb(0xFF, 0x44, 0x44, 0x44));
            resourceDictionary.SetBrush("MahApps.HamburgerMenu.PaneForeground", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
        }
Esempio n. 16
0
        internal static void SetMahAppsBaseTheme(this ResourceDictionary resourceDictionary, BaseTheme baseTheme)
        {
            var foo = ThemeManager.Themes;

            switch (baseTheme)
            {
            case BaseTheme.Light:
                resourceDictionary["Theme.BaseColorScheme"] = ThemeManager.BaseColorLight;
                resourceDictionary.SetColor("MahApps.Colors.Black", Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
                resourceDictionary.SetColor("MahApps.Colors.Black20", Color.FromArgb(0x51, 0x00, 0x00, 0x00));
                resourceDictionary.SetColor("MahApps.Colors.White", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.White20", Color.FromArgb(0x51, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.Gray1", Color.FromArgb(0xFF, 0x33, 0x33, 0x33));
                resourceDictionary.SetColor("MahApps.Colors.Gray2", Color.FromArgb(0xFF, 0x7F, 0x7F, 0x7F));
                resourceDictionary.SetColor("MahApps.Colors.Gray3", Color.FromArgb(0xFF, 0x9D, 0x9D, 0x9D));
                resourceDictionary.SetColor("MahApps.Colors.Gray4", Color.FromArgb(0xFF, 0xA5, 0x9F, 0x93));
                resourceDictionary.SetColor("MahApps.Colors.Gray5", Color.FromArgb(0xFF, 0xB9, 0xB9, 0xB9));
                resourceDictionary.SetColor("MahApps.Colors.Gray6", Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC));
                resourceDictionary.SetColor("MahApps.Colors.Gray7", Color.FromArgb(0xFF, 0xD8, 0xD8, 0xD9));
                resourceDictionary.SetColor("MahApps.Colors.Gray8", Color.FromArgb(0xFF, 0xE0, 0xE0, 0xE0));
                resourceDictionary.SetColor("MahApps.Colors.Gray9", Color.FromArgb(0x5E, 0xC9, 0xC9, 0xC9));
                resourceDictionary.SetColor("MahApps.Colors.Gray10", Color.FromArgb(0xFF, 0xF7, 0xF7, 0xF7));
                resourceDictionary.SetColor("MahApps.Colors.GrayNormal", Color.FromArgb(0xFF, 0xBE, 0xBE, 0xBE));
                resourceDictionary.SetColor("MahApps.Colors.GrayHover", Color.FromArgb(0xFF, 0x33, 0x33, 0x33));
                resourceDictionary.SetColor("MahApps.Colors.Flyout", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.MenuShadow", Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
                resourceDictionary.SetColor("MahApps.Colors.MenuItem.DisabledForeground", Color.FromArgb(0xFF, 0x7F, 0x7F, 0x7F));
                resourceDictionary.SetColor("MahApps.Colors.SliderValue.Disabled", Color.FromArgb(0xFF, 0xBA, 0xBA, 0xBA));
                resourceDictionary.SetColor("MahApps.Colors.SliderTrack.Disabled", Color.FromArgb(0xFF, 0xDB, 0xDB, 0xDB));
                resourceDictionary.SetColor("MahApps.Colors.SliderThumb.Disabled", Color.FromArgb(0xFF, 0xA0, 0xA0, 0xA0));
                resourceDictionary.SetColor("MahApps.Colors.SliderTrack.Hover", Color.FromArgb(0xFF, 0xD0, 0xD0, 0xD0));
                resourceDictionary.SetColor("MahApps.Colors.SliderTrack.Normal", Color.FromArgb(0xFF, 0xC6, 0xC6, 0xC6));
                resourceDictionary.SetColor("MahApps.Colors.FlatButton.PressedBackground", Color.FromRgb(0x22, 0x22, 0x22));
                resourceDictionary.SetColor("MahApps.Colors.MenuItem.SelectionFill", Color.FromRgb(0xDE, 0xDE, 0xDE));
                resourceDictionary.SetColor("MahApps.Colors.MenuItem.SelectionStroke", Color.FromRgb(0xDE, 0xDE, 0xDE));
                resourceDictionary.SetColor("MahApps.Colors.TopMenuItem.PressedFill", Color.FromRgb(0xDE, 0xDE, 0xDE));
                resourceDictionary.SetColor("MahApps.Colors.TopMenuItem.PressedStroke", Color.FromArgb(0xE0, 0x71, 0x70, 0x70));
                resourceDictionary.SetColor("MahApps.Colors.TopMenuItem.SelectionStroke", Color.FromArgb(0x90, 0x71, 0x70, 0x70));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.Pressed.Win10", Color.FromArgb(0xFF, 0x66, 0x66, 0x66));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OffBorder.Win10", Color.FromArgb(0xFF, 0x33, 0x33, 0x33));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OffMouseOverBorder.Win10", Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OffDisabledBorder.Win10", Color.FromArgb(0xFF, 0x99, 0x99, 0x99));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OnSwitchDisabled.Win10", Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicator.Win10", Color.FromArgb(0xFF, 0x33, 0x33, 0x33));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicatorMouseOver.Win10", Color.FromArgb(0xFF, 0x00, 0x00, 0x00));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicatorPressed.Win10", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicatorDisabled.Win10", Color.FromArgb(0xFF, 0x99, 0x99, 0x99));
                resourceDictionary.SetColor("MahApps.Colors.Badged.DisabledBackground", Color.FromArgb(0xFF, 0x99, 0x99, 0x99));
                break;

            case BaseTheme.Dark:
                resourceDictionary["Theme.BaseColorScheme"] = ThemeManager.BaseColorDark;
                resourceDictionary.SetColor("MahApps.Colors.Black", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.Black20", Color.FromArgb(0x51, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.White", Color.FromArgb(0xFF, 0x25, 0x25, 0x25));
                resourceDictionary.SetColor("MahApps.Colors.White20", Color.FromArgb(0x51, 0x25, 0x25, 0x25));
                resourceDictionary.SetColor("MahApps.Colors.Gray1", Color.FromArgb(0xFF, 0xF9, 0xF9, 0xF9));
                resourceDictionary.SetColor("MahApps.Colors.Gray2", Color.FromArgb(0xFF, 0x7F, 0x7F, 0x7F));
                resourceDictionary.SetColor("MahApps.Colors.Gray3", Color.FromArgb(0xFF, 0x9D, 0x9D, 0x9D));
                resourceDictionary.SetColor("MahApps.Colors.Gray4", Color.FromArgb(0xFF, 0xA5, 0x9F, 0x93));
                resourceDictionary.SetColor("MahApps.Colors.Gray5", Color.FromArgb(0xFF, 0xB9, 0xB9, 0xB9));
                resourceDictionary.SetColor("MahApps.Colors.Gray6", Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC));
                resourceDictionary.SetColor("MahApps.Colors.Gray7", Color.FromArgb(0xFF, 0x7E, 0x7E, 0x7E));
                resourceDictionary.SetColor("MahApps.Colors.Gray8", Color.FromArgb(0xFF, 0x45, 0x45, 0x45));
                resourceDictionary.SetColor("MahApps.Colors.Gray9", Color.FromArgb(0x5E, 0xC9, 0xC9, 0xC9));
                resourceDictionary.SetColor("MahApps.Colors.Gray10", Color.FromArgb(0xFF, 0x2F, 0x2F, 0x2F));
                resourceDictionary.SetColor("MahApps.Colors.GrayNormal", Color.FromArgb(0xFF, 0x7D, 0x7D, 0x7D));
                resourceDictionary.SetColor("MahApps.Colors.GrayHover", Color.FromArgb(0xFF, 0xAA, 0xAA, 0xAA));
                resourceDictionary.SetColor("MahApps.Colors.Flyout", Color.FromArgb(0xFF, 0x2B, 0x2B, 0x2B));
                resourceDictionary.SetColor("MahApps.Colors.MenuShadow", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.MenuItem.DisabledForeground", Color.FromArgb(0xFF, 0x7E, 0x7E, 0x7E));
                resourceDictionary.SetColor("MahApps.Colors.SliderValue.Disabled", Color.FromArgb(0xFF, 0x53, 0x53, 0x53));
                resourceDictionary.SetColor("MahApps.Colors.SliderTrack.Disabled", Color.FromArgb(0xFF, 0x38, 0x38, 0x38));
                resourceDictionary.SetColor("MahApps.Colors.SliderThumb.Disabled", Color.FromArgb(0xFF, 0x7E, 0x7E, 0x7E));
                resourceDictionary.SetColor("MahApps.Colors.SliderTrack.Hover", Color.FromArgb(0xFF, 0x73, 0x73, 0x73));
                resourceDictionary.SetColor("MahApps.Colors.SliderTrack.Normal", Color.FromArgb(0xFF, 0x6C, 0x6C, 0x6C));
                resourceDictionary.SetColor("MahApps.Colors.FlatButton.PressedBackground", Color.FromRgb(0x44, 0x44, 0x44));
                resourceDictionary.SetColor("MahApps.Colors.MenuItem.SelectionFill", Color.FromRgb(0x31, 0x31, 0x31));
                resourceDictionary.SetColor("MahApps.Colors.MenuItem.SelectionStroke", Color.FromRgb(0x31, 0x31, 0x31));
                resourceDictionary.SetColor("MahApps.Colors.TopMenuItem.PressedFill", Color.FromRgb(0x31, 0x31, 0x31));
                resourceDictionary.SetColor("MahApps.Colors.TopMenuItem.PressedStroke", Color.FromArgb(0xE0, 0x71, 0x70, 0x70));
                resourceDictionary.SetColor("MahApps.Colors.TopMenuItem.SelectionStroke", Color.FromArgb(0x90, 0x71, 0x70, 0x70));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.Pressed.Win10", Color.FromArgb(0xFF, 0x99, 0x99, 0x99));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OffBorder.Win10", Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OffMouseOverBorder.Win10", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OffDisabledBorder.Win10", Color.FromArgb(0xFF, 0x66, 0x66, 0x66));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.OnSwitchDisabled.Win10", Color.FromArgb(0xFF, 0x44, 0x44, 0x44));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicator.Win10", Color.FromArgb(0xFF, 0xCC, 0xCC, 0xCC));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicatorMouseOver.Win10", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicatorPressed.Win10", Color.FromArgb(0xFF, 0xFF, 0xFF, 0xFF));
                resourceDictionary.SetColor("MahApps.Colors.ToggleSwitchButton.ThumbIndicatorDisabled.Win10", Color.FromArgb(0xFF, 0x66, 0x66, 0x66));
                resourceDictionary.SetColor("MahApps.Colors.Badged.DisabledBackground", Color.FromArgb(0xFF, 0x66, 0x66, 0x66));
                break;
            }
        }
Esempio n. 17
0
 public static void SetTheme(DependencyObject obj, BaseTheme value)
 {
     obj.SetValue(ThemeProperty, value);
 }
Esempio n. 18
0
 /// <summary>
 /// Sets the current active <see cref="BaseTheme"/> by the specified one.
 /// </summary>
 /// <param name="themeName">The name of the Theme to apply.</param>
 public static void SetActiveApplicationTheme(BaseTheme theme)
 {
     mApplicationTheme = theme;
 }
Esempio n. 19
0
        /* Private Methods */

        private void SetCurrentBaseTheme(BaseTheme baseTheme)
        {
            _currentBaseTheme = baseTheme;
            UpdateResources();
            LocalSettings.Theme.Base = baseTheme.ThemeKey;
        }