I have seen an old post from last year of someone else trying to do something similar so I am hoping there may be an update... Basically, I would like to be able to only download the theme when I need it and I intend to use MEF to accomplish this. I have created a Silverlight App (therefore generates a theme.xap) which references:
- one of the Telerk Themes projects eg. Expression_Dark
- Telerik.Windows.COntrols.dll
All goes well until I call StyleManager.ApplicationTheme = newTheme
Stack trace of error below seems to imply that something is looking for the controlAssembly - Which controlAssembly? (I know and can also prove that Telerik.Windows.Controls is loaded.)
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at Telerik.Windows.Controls.Theme.CreateResourceDictionaryForApplicationTheme(Theme theme, String controlAssembly)
at Telerik.Windows.Controls.StyleManager.OnApplicationThemeChanged(Theme oldValue, Theme newValue)
at Telerik.Windows.Controls.StyleManager.set_ApplicationTheme(Theme value)
at MyCompany.MyProject.Shell.Shell.SetTheme(IMyProjectTheme theNewTheme, Exception e)
I know my theme xap is loaded as I have executed some other temporary code inside it to prove this point. I have also tried deriving from Theme and making a generic.xaml that Merges all other bits from the Telerik own Expression_Dark project but also to no avail.
I think all is well in my theme XAP and with my logic because if the root silverlight application has an assembly reference to the Expression_Dark dll itself then all works ok it is only when I rely on this dll being delivered by the theme xap that it all falls apart.
Any help would be much appreciated
Regards, Des
- one of the Telerk Themes projects eg. Expression_Dark
- Telerik.Windows.COntrols.dll
All goes well until I call StyleManager.ApplicationTheme = newTheme
Stack trace of error below seems to imply that something is looking for the controlAssembly - Which controlAssembly? (I know and can also prove that Telerik.Windows.Controls is loaded.)
at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, String s)
at MS.Internal.XcpImports.SetValue(IManagedPeerBase doh, DependencyProperty property, Object obj)
at System.Windows.DependencyObject.SetObjectValueToCore(DependencyProperty dp, Object value)
at System.Windows.DependencyObject.SetEffectiveValue(DependencyProperty property, EffectiveValueEntry& newEntry, Object newValue)
at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
at System.Windows.ResourceDictionary.set_Source(Uri value)
at Telerik.Windows.Controls.Theme.CreateResourceDictionaryForApplicationTheme(Theme theme, String controlAssembly)
at Telerik.Windows.Controls.StyleManager.OnApplicationThemeChanged(Theme oldValue, Theme newValue)
at Telerik.Windows.Controls.StyleManager.set_ApplicationTheme(Theme value)
at MyCompany.MyProject.Shell.Shell.SetTheme(IMyProjectTheme theNewTheme, Exception e)
I know my theme xap is loaded as I have executed some other temporary code inside it to prove this point. I have also tried deriving from Theme and making a generic.xaml that Merges all other bits from the Telerik own Expression_Dark project but also to no avail.
I think all is well in my theme XAP and with my logic because if the root silverlight application has an assembly reference to the Expression_Dark dll itself then all works ok it is only when I rely on this dll being delivered by the theme xap that it all falls apart.
Any help would be much appreciated
Regards, Des