This is a migrated thread and some comments may be shown as answers.

Loading Telerik Themes dynamically (MEF support?)

2 Answers 47 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 17 May 2010, 10:45 AM
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 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 21 May 2010, 01:38 PM
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.
0
Ian
Top achievements
Rank 1
answered on 21 May 2010, 07:02 PM
Thanks for the reply.

Regards,
Ian
Tags
General Discussions
Asked by
Ian
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Ian
Top achievements
Rank 1
Share this question
or