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

Problem setting themes

1 Answer 126 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Michael Salzlechner
Top achievements
Rank 1
Michael Salzlechner asked on 07 Jun 2011, 02:05 PM
i have a few silverlight apps that use rad controls. Recently we wanted to change the theme so as per documentation i added the following to the application code


public partial class MyMainPage : MainPageUserControl
        public MyMainPage()
            StyleManager.ApplicationTheme = new Office_BlueTheme();

when i run the app i get the login screen and after that when it tried to create the mainpage i get the following

Line: 56
Error: Unhandled Error in Silverlight Application 
Code: 4004    
Category: ParserError       
Message: Set property 'System.Windows.FrameworkElement.Style' threw an exception.     
Line: 3275     
Position: 59     

any idea what to look for why this could happen ?

as soon as i comment out the line to create the theme everything is happy again

i referenced Telerik.Windows.Controls as well as Telerik.Windows.Themes.Office_Blue (tried Vista also)

the main page consists of a RadRibbonBar RadDocking containers and RadOutlookbar

any help would be appreciated


1 Answer, 1 is accepted

Sort by
Michael Salzlechner
Top achievements
Rank 1
answered on 07 Jun 2011, 03:11 PM

a little update

i tried to set the theme manually at certain controls such as the ribbonbar and that actually works

i then noticed that i could add the theme to the ribbonbar and even a Border but when adding it to a RadOutlookBar the designer throws an exception and i also get the same exception as before during runtime

if i set the theme to a RadDocking control that ultimately contains the RadOutlookBar the design view still works but the outlook bar disappears. Then when refreshing the design view the following error occurs

Error   11  A ResourceDictionary '/Telerik.Windows.Themes.Office_Blue;component/Themes/Telerik.Windows.Controls.xaml' cannot be found.
Please make sure that references to the needed theme assemblies have been added to the project. 
C:\Projects\Customers\Canesto\source\CIMSHR\Dev\Canesto\Amigo\Main\AmigoMainPage.xaml   1   1   Amigo.Main

well i checked and noticed that my reference to the theme was pointing to an older version of the telerik dll not the 2011 Q1

changed the reference, rebuilt and all is happy now ...

General Discussions
Asked by
Michael Salzlechner
Top achievements
Rank 1
Answers by
Michael Salzlechner
Top achievements
Rank 1
Share this question