I am trying to create a new theme based off your existing Windows 7 theme. I am using SL 4, VS 2010, with Telerik Silverlight Controls 2009 Q3 SP2.
I have read the following threads:
Among others, as well as followed the instructions on creating a new theme in both the online and supplied documentation.
I have tried to use the supplied custom theme in the first url however, after converting the project to SL4 / VS 2010 it does not work, it throws an exception during runtime about not being able to find some references to needed theme assemblies.
The steps that I have taken are as follows:
1. Create a new SL 4 project
2. Add references to all the system & Telerik assemblies that the Windows7 theme project references
3. Copy all the XAML files from the Windows7 theme into the new project and add them to the project. (Changing to a Resource build type with a build tool of MSBuild:MarkupCompilePass1, as it is in the Windows7 project)
4. Adjust namespaces / assembly names inside the XAML
5. Correct a few references to xmlns:telerik="clr-namespace:Telerik.Windows.Controls" to include the assembly "Telerik.Windows.Controls" to stop ReSharper complaining about them
6. Create a new class that inherits from the Theme class and loads the source ("/MyProjectName;Component/Themes/Generic.xaml")
7. Add a Generic.xaml file inside the Themes folder of my new Theme project that is based off the Generic.xaml file inside the Telerik.Windows.Control library (again adjusting paths / namespaces)
8. Assign the theme to the application, or to a control using the steps described in the documentation (that work with the Telerik supplied themes)
Is there anything that I am missing, or have done incorrectly? In particular should I:
- Change the build tool to MSBuild:MarkUpCompilePass1 as it is in your themes loaded with VS2008, but by default resources are compiled using MSBuild:Compile
- Use the Resource Build Action as it states in your documentation, or use the Page build action as it is set in the solution supplied by Telerik inside the first URL above.
- Correct the telerik xmlns declaration to include the assemblies, even though the XAML in the affected files does not reference this tag
In terms of what happens, if I load the theme as an application theme I get a generic XmlParseException with the code AG_E_UNKNOWN_ERROR on the line where the first themed control is declared. If I assign to an individual control instead of across the entire application I get a COMException HRESULT_E_FAIL which according to the stack trace is when the style manager is trying to assign the theme to the control.
I have examined my theme class library and aside from it containing the theme class (As the Windows7 theme class resides in Telerik.Windows.Controls), its own generic.xaml file, and different project names it is no different from the Windows7 theme class library. This includes an eyeballing analysis using Reflector.
Do you have any ideas on what it could be?