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

Implicit themes in control library

2 Answers 115 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jason D
Top achievements
Rank 1
Veteran
Jason D asked on 10 Oct 2016, 10:41 PM

I created a test application with a treeview using implicit themes with the XAML files loaded into project. That works fine. If I move the treeview into a usercontrol in a separate project, it does not work. I tried both methods from here with no success:

https://blogs.msdn.microsoft.com/wpfsdk/2007/06/08/defining-and-using-shared-resources-in-a-custom-control-library/

It fails when loading Telerik.Windows.Controls.Navigation.xaml. It doesn't have a problem loading Telerik.Windows.Controls.xaml. The sample in the link

As a side note, I am doing the same thing with the map control and don't have any issues with it.

Link to the Project:
https://file.ac/1GnUz6lTPqM/

Here's the snippet from the UserControl:

<UserControl.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="Themes/System.Windows.xaml"/>
            <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml"/>
            <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Navigation.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</UserControl.Resources>

2 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 11 Oct 2016, 07:55 AM
Hello Jason,

When you define control library that uses third party dlls (as Telerik) you will need to reference those dlls also in the project that uses the control library. In order to resolve the error on your side you can reference the Telerik dlls also in the TelerikWpfApp1.

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Jason D
Top achievements
Rank 1
Veteran
answered on 11 Oct 2016, 03:22 PM
Perfect! Thanks very much.
Tags
TreeView
Asked by
Jason D
Top achievements
Rank 1
Veteran
Answers by
Martin Ivanov
Telerik team
Jason D
Top achievements
Rank 1
Veteran
Share this question
or