Custom Theme HowTo

8 posts, 0 answers
  1. Inga
    Inga avatar
    1 posts
    Member since:
    Jun 2012

    Posted 13 Jul 2012 Link to this post

    Hello,

    i'm looking for hours for a working guide to add a custom theme for some controls (for example the scheduler) and using it in my application.
    I want to make a new theme based on the metro theme.

    The howto's i found arn't working ... for example
    http://www.telerik.com/support/kb/wpf/scheduler/how-to-implement-a-new-custom-theme-in-a-few-steps.aspx

    And this link is broken
    http://www.telerik.com/help/wpf/common-styling-apperance-themes-custom-theme-project-telerik-approach.html

    I hope anybody can tell me how it works?

    My version is "RadControls for WPF Q2 2012"

    I look forward to your answers!
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 16 Jul 2012 Link to this post

    Hi Inga,

     

    Actually the referred articles are not valid and in the newer version the procedure of creating custom theme is a bit different.  
    Please follow these steps when dealing with custom theme in our newest version:
    1. Create a new Class LIbrary named MyTheme and add the following piece of code within MyTheme.cs:

    namespace MyTheme
    {
        [ThemeLocation(ThemeLocation.External)]
        public class MyCustomTheme:Theme
        {
        }
    }


    2.Please ensure that in AssemblyInfo.cs of MyTheme Class Library the following piece of code is included: 

    [assembly: ThemeInfo(
        ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
        //(used if a resource is not found in the page,
        // or application resource dictionaries)
        ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
        //(used if a resource is not found in the page,
        // app, or any theme specific resource dictionaries)
    )]


    3. Add a new Themes folder with the corresponding ResourceDictionaries for RadGridView (located on..\Q1 2012 Official\WPF\Themes\WPF40\Summer):
    System.Windows.xaml, Telerik.Windows.Controls.xaml, Telerik.Windows.Controls.Input.xaml, Telerik.Windows.Controls.GridView.xaml.

    4.Specify the external namespace and the Key for your theme in all ResourceDictionaries as follows:  

    xmlns:external="clr-namespace:MyTheme"
    <external:MyCustomTheme x:Key="Theme" />

    5. The last step is to ensure that the ThemeType of all styles refer to our custom theme:  

    <Style x:Key="{telerik:ThemeResourceKey ThemeType=external:MyCustomTheme , ElementType=grid:AggregateResultsList}"
            TargetType="grid:AggregateResultsList" BasedOn="{StaticResource AggregateResultsListStyle}"/>


    You may find attached sample application which illustrates this approach.
    Furthermore I believe that the following forum thread might be useful on that matter as well.  


    I look forward to hearing from you!   

    Greetings,
    Vanya Pavlova
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    2 posts
    Member since:
    Sep 2013

    Posted 17 Dec 2013 Link to this post

    Hi, I'm mostly a front-end XAML developer and know very little about build and assembly matters.

    So, I was wondering if those assembly values are to be taken literally, or are they just example placeholders we should replace with something else? In other words, Do I literally just supply ResourceDictionaryLocation.None
  5. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 18 Dec 2013 Link to this post

    Hi David,



    You may check the following thread, where you may find a detailed information on that matter. 


    Regards,
    Vanya Pavlova
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Dimitar
    Dimitar avatar
    3 posts
    Member since:
    Aug 2014

    Posted 12 Aug 2014 Link to this post

    Hi Vania, can you update the project you attached as a reply to Inga, so that it works with version 2014.2.729.45 of telerik. I am getting build errors.
    Thanks
    Dimitar
  7. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 12 Aug 2014 Link to this post

    Hi Dimitar,


    Thank you for contacting us.

    The sample project uses older version of UI for WPF and referencing the dlls from the latest version would not upgrade the project, because the xaml is different. 

    As you may know, we support different theming mechanisms - StyleManager and Implicit Styles. 
    You could take a look at the following blog post "XAML Theming – Implicit Styles versus StyleManager".

    We strongly encourage our customers to use pure implicit styles combined with NoXAML binaries, which are more maintainable. You may also check our online documentation for further reference. 



    Regards,
    Vanya Pavlova
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  8. Dimitar
    Dimitar avatar
    3 posts
    Member since:
    Aug 2014

    Posted 12 Aug 2014 in reply to Vanya Pavlova Link to this post

    Vania,
    Thanks for the quick reply, this looks promising... 
    Will try it and let you know how it goes..

    P.P.
    Having spent a couple of hours digging through threads on this forum, I have a suggestion you might want to propose to the team supporting it. It would be great if there was an option to sort your search results by date, so the most recent threads stay on top as they will be most relevant. 

  9. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 13 Aug 2014 Link to this post

    Hello,

    Thank you for sharing your feedback.
    I logged it at our Telerik 3.0 Feedback Portal where you can follow its progress: http://teampulse.telerik.com:9896/Project/268/Feedback/List/Your%20Items.


    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready