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

Assembly 'Telerik.Windows.Themes.Green' is not referenced by this project.

3 Answers 428 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 23 Apr 2016, 08:31 PM

I am trying to follow the instructions from:  http://docs.telerik.com/devtools/wpf/styling-and-appearance/styling-apperance-implicit-styles-overview.html#applying-theme-globally-in-your-application  From the picture below you can see that it definitely is in my list of References. I apologize if this is a stupid question as I am fairly new to WPF (WinForms was my thing).

http://i.stack.imgur.com/fBtbQ.png

 

I included a Theme's Folder and put the XAML files into that.  I am able to reference them with out error but it does not seem to want to apply the theme to my button type:

                <ResourceDictionary Source="/Themes/System.Windows.xaml"/>

                 <ResourceDictionary Source="/Themes/Telerik.Windows.Controls.xaml"/>

 

As you can see in the picture I have tried using the dll files as references but it doesn't they they are referenced.

                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/System.Windows.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>

 

 

Anyone able to tell me why it is not able to use the Theme Green dll Reference?

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 27 Apr 2016, 02:17 PM
Hi Jon,

In order to apply globally the theme for the application, you could include the references in the App.xaml file as follows:
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/System.Windows.xaml" />
            <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.xaml" />
            <ResourceDictionary Source="/Telerik.Windows.Themes.Green;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

As for the error, I cannot reproduce the specified case, so could I ask you to provide me with additional information about your controls - whether you are using custom styles or custom controls, which you want to style. Referencing the Theme in Window.Resources works as well, but it will apply only locally to the controls in the current Window/UserControl, not globally for the whole application.

You can also try to manually delete the "bin" and "obj" folders of the project and then Clean, and Rebuild the solution.

Regards,
Martin
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Jon
Top achievements
Rank 1
answered on 27 Apr 2016, 05:59 PM

Martin,

    Thank you for the reply.  I have made a project that is dedicated to my UI's only.  It is loaded as a reference in my UI Project and I am using VS 2015.    The UI project itself is almost 100% empty.  You can download it for review here:  https://www.dropbox.com/s/u3ea5790yvnvioi/UiBuilder.zip?dl=0

Thank you for taking the time to investigate this further for me.  I am really looking forward to this working as planned!

0
Martin
Telerik team
answered on 02 May 2016, 08:06 AM
Hello Jon,

I have ran your project, here is a link to the video. I have referenced the .dll-s for the included controls (Controls and GrivView) and the Green theme. I experience no problem so far as I see it. Do you receive and exception or if not, could you provide some additional information for any problems you are having?

However, I noticed that your project references only Telerik.Windows.Controls.dll and Telerik.Windows.Themes.Green.dll. But the Telerik.Windows.Controls.Navigation.xaml resource dictionary is also merged in the resources of the application. In this case an exception will be thrown. To resolve this you can add the Navigation assembly in the project or remove the Navigation ResourceDictionary merged in the application resources. In order for the project to run properly you will also need to add a reference ot the GridView assembly.

Regards,
Martin
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
General Discussions
Asked by
Jon
Top achievements
Rank 1
Answers by
Martin
Telerik team
Jon
Top achievements
Rank 1
Share this question
or