How can I get the light green theme at design time?

8 posts, 0 answers
  1. IT-Support
    IT-Support avatar
    9 posts
    Member since:
    Dec 2011

    Posted 21 Apr 2016 Link to this post

    Hi telerik experts,

    I want to use the light green theme for my application, which fits perfectly at runtime.I switch to light palette when the application starts up: GreenPalette.LoadPreset(GreenPalette.ColorVariation.Light); and everything is fine.

    The only problem is, that the designer (VS and Blend) always shows the dark green theme. This makes the design of the views a little bit hard. Is there a way that the light green theme is used in the designer?

    Best regards,
    Thomas

  2. Evgenia
    Admin
    Evgenia avatar
    1431 posts

    Posted 25 Apr 2016 Link to this post

    Hello Thomas,

    Unfortunately I should admit that switching color variations doesn't affect the design time of our controls. This is a known issue that can be reproduced both in VisualStudio designer and ExpressionBlend. Our developers are known of this limitation and we will further investigate the reasons. At this moment I can't provide a workaround. 
    We are sorry for any inconvenience this may have caused. 

    Regards,
    Evgenia
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. Stefan Bernbo
    Stefan Bernbo avatar
    3 posts
    Member since:
    Sep 2009

    Posted 02 Jan in reply to Evgenia Link to this post

    I agree with Thomas. When will this be fixed? It is quite annoying and should be an easy fix for you.
  4. Martin
    Admin
    Martin avatar
    75 posts

    Posted 03 Jan Link to this post

    Hi,

    The way the theme variations work, and the design time evaluation of the styles and the theme resources, do not provide a design time variation change in the conventional method.

    What we could suggest as a workaround to apply the variation change in the static constructor of the MainWindow in order to see it in the designer and Blend as well. Since the static constructor is executed 
    static MainWindow()
    {
      GreenPalette.LoadPreset(GreenPalette.ColorVariation.Light);
    }


    Regards,
    Martin
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  5. Stefan Bernbo
    Stefan Bernbo avatar
    3 posts
    Member since:
    Sep 2009

    Posted 04 Jan in reply to Martin Link to this post

    Hi Martin,

    I tried that now, but it doesn't seem to work. I'm using Visual Studio 2013 only.

    Did you get that to work with Studio?

    Best / Stefan

  6. Martin
    Admin
    Martin avatar
    75 posts

    Posted 04 Jan Link to this post

    Hi Stefan,

    I used it in VisualStudio 2013 exactly and it does work in the Designer. Try closing the MainWindow, then the Studio and rebuilding the project before you reopen the designer.

    If you are referring to the VisualStudio2013 theme - works with it as well.

    I am attaching a sample project of the implementation just in case.

    Regards,
    Martin
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  7. Stefan Bernbo
    Stefan Bernbo avatar
    3 posts
    Member since:
    Sep 2009

    Posted 04 Jan in reply to Martin Link to this post

    Thanks for the sample project. I noticed that your project works, but mine is still not working.

    I guess that is because my MainWindow is a RadWindow, not a Window. Have you tried with that?

    Best / Stefan

  8. Martin
    Admin
    Martin avatar
    75 posts

    Posted 05 Jan Link to this post

    Hi Stefan ,

    Same approach works fine with RadWindow as well - when it is instead of the MainWindow, as well as when is is used as a user control. Note that you might need to merge a style for the RadWindows in App.xaml.

    I have modified the previous project to include RadWindows with static constructors again. Note that in order to use it as a MainWindow, besides all shown in our SDK about it, the thing that is missed most often is that the StartupUri needs to be removed from App.xaml.

    Regards,
    Martin
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top