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

4 posts, 0 answers
  1. Jon
    Jon avatar
    2 posts
    Member since:
    Apr 2016

    Posted 23 Apr Link to this post

    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?

  2. Martin
    Admin
    Martin avatar
    60 posts

    Posted 27 Apr Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Jon
    Jon avatar
    2 posts
    Member since:
    Apr 2016

    Posted 27 Apr in reply to Martin Link to this post

    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!

  5. Martin
    Admin
    Martin avatar
    60 posts

    Posted 02 May Link to this post

    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.
Back to Top