Problem setting themes

2 posts, 0 answers
  1. Michael Salzlechner
    Michael Salzlechner avatar
    41 posts
    Member since:
    Jan 2010

    Posted 07 Jun 2011 Link to this post

    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();
      
                InitializeComponent();
            }

    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.     
    File:      
    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

    Mike
  2. Michael Salzlechner
    Michael Salzlechner avatar
    41 posts
    Member since:
    Jan 2010

    Posted 07 Jun 2011 Link to this post

    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 ...

Back to Top