Loading Telerik Themes dynamically (MEF support?)

3 posts, 0 answers
  1. Ian
    Ian avatar
    51 posts
    Member since:
    Apr 2009

    Posted 17 May 2010 Link to this post

    I'm looking for a way to download specific Telerik themes (dlls) dynamically at run time to avoid the overhead of downloading all possible themes (significantly adding to download times) when only one (determined at run time based on user selection or querystring parameter) is required by the user at any one time.

    The example code I've found in the Telerik documentation seems to assume all Theme dlls will be referenced (and downloaded) as part of the main project.  Is there a documented process/sample code for doing what I want with the Telerik theme dlls?

    Ideally I would like to use MEF to dynamically load the required theme. If I had written the theme myself I would do this by defining an ITheme interface and decorating my various Theme classes with the appropriate Export attribute. There is a good overview of this process here: http://www.silverlightshow.net/items/Honey-I-MEF-fed-the-Silverlight-Gallery-for-Christmas-Part-1.aspx 

    Is there something similar available for the Telerik theme dlls? (eg is there a defined ITheme interface and have the classes been decorated with the Export attribute) or is there another way to achieve what I want?

    Thanks,
    Ian

  2. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 21 May 2010 Link to this post

    Hi Ian,

    Frankly, we have not tried this approach and therefore we have no proper articles or guidelines on how to do accomplish this goal. I checked with our devs and they said that this would not be so easy to achieve.
    There is no dedicated ITheme interface that could help you in this specific case. Additionally, our Theme assemblies are just containers for XAML files, there are no classes defined inside them, hence I suppose MEF will not be able to load them automatically. You could give this approach a go and let us know if you face certain difficulties.

    Best wishes,
    Nick
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Ian
    Ian avatar
    51 posts
    Member since:
    Apr 2009

    Posted 21 May 2010 Link to this post

    Thanks for the reply.

    Regards,
    Ian
Back to Top