VisualStudio2013 theme color variation at design time

5 posts, 0 answers
  1. Patrick
    Patrick avatar
    5 posts
    Member since:
    Sep 2016

    Posted 19 Sep Link to this post

    Is there a way to set the color variation at design time?
  2. Martin
    Admin
    Martin avatar
    60 posts

    Posted 20 Sep Link to this post

    Hello Patrick,

    Theme variations are set in code behind. For the VisualStudio2013 theme they are Light, Blue, Dark:
    VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);

    You can review this article about the specific theme for more information.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft banner
  4. Patrick
    Patrick avatar
    5 posts
    Member since:
    Sep 2016

    Posted 20 Sep in reply to Martin Link to this post

    Yes, I realize all that.  That changes the color variation at runtime.  I'm asking whether or not there is a way to change it at design time.  At design time, the Light color variation is always used.  I'm using  the Dark variation, so having the app look different at design time and run time makes styling it difficult.
  5. Martin
    Admin
    Martin avatar
    60 posts

    Posted 20 Sep Link to this post

    Hello Patrick,

    The way to see the variation of the theme in Design time or in Expression Blend is to load the preset in a static constructor of the MainWindow and Rebild if needed:
    public partial class MainWindow : Window
    {
      public MainWindow()
      {
      InitializeComponent();
      }
     
      static MainWindow()
      {
      VisualStudio2013Palette.LoadPreset(VisualStudio2013Palette.ColorVariation.Dark);
      }
    }

    I verified this approach in VS2012, VS2013, VS2015.

    Regards,
    Martin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Patrick
    Patrick avatar
    5 posts
    Member since:
    Sep 2016

    Posted 21 Sep in reply to Martin Link to this post

    Worked like a charm.  Thanks.
Back to Top
DevCraft banner