Reporting Control themes effect my Micrsoft WPF Controls in Project

5 posts, 1 answers
  1. muhammad
    muhammad avatar
    4 posts
    Member since:
    Jul 2018

    Posted 07 Nov 2019 Link to this post

    I am implementing Telerik reporting in my already writen WPF Project. The Project has only microsoft WPF controls but when I make a report with telerik reporting and add resource dictionary sources from Telerik.ReportViewer.Wpf.Themes.dll in APP.XAML  file it effects all my Microsoft controls in entire project. I need solution that limit telerik themes to its report control only. Please guide me with detail I am newbie in Telerik reporting, Thanks

    I am using telerik reporting R2 2019 version.

    Code

     

    APP.XAML

    <Application x:Class="BMS.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 Startup="Application_Startup" DispatcherUnhandledException="Application_DispatcherUnhandledException" 
            
                 SessionEnding="Application_SessionEnding" Exit="Application_Exit" >
        <Application.Resources>
            <ResourceDictionary>
                <ResourceDictionary.MergedDictionaries>
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/System.Windows.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.Input.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.Windows.Controls.Navigation.xaml" />
                    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/Telerik.ReportViewer.Wpf.xaml" />
                </ResourceDictionary.MergedDictionaries>
            </ResourceDictionary>
        </Application.Resources>
    </Application>

    This Code effect all my micrsoft controls

    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    I am using alll references from this folder only.

    C:\Program Files (x86)\Progress\Telerik Reporting R2 2019\Bin

     

     

     

     

  2. Neli
    Admin
    Neli avatar
    212 posts

    Posted 12 Nov 2019 Link to this post

    Hello Muhammad,

    We were able to reproduce the issue. A member from Telerik UI for WPF and I inspected the behavior and we found that this outcome is based on how WPF works. At this point, the option that we recommend to try is to remove the System.Windows.xaml from the resource dictionary:

    <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Fluent/System.Windows.xaml" />
    

    You can test the solution, then let us know if it works for you.

    Regards,
    Neli
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. muhammad
    muhammad avatar
    4 posts
    Member since:
    Jul 2018

    Posted 22 Nov 2019 Link to this post

    Hi i did try the above given solution but it still wont work for me. The style of button and text box is still changed due to the report theming. I try to move the resources to report viewer form class code behind but it threw an exception radloading component not found. Kindly give me working solution i am short on deadline thanks.
  4. Answer
    Neli
    Admin
    Neli avatar
    212 posts

    Posted 26 Nov 2019 Link to this post

    Hi Muhammad,

    Fortunately, there is another workaround that we can suggest. Below are the required steps:

    1. Add a folder Themes and insert the themes that you would like to use;

    2. Remove them from the App.xml file;

    3. Open Telerik.ReportViewer.Wpf.xaml file and add the rest of the themes before the declaration of the fonts:

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Themes/
        <ResourceDictionary Source="/Themes/
        <ResourceDictionary Source="/Themes/
        <ResourceDictionary Source="/Themes/
    </ResourceDictionary.MergedDictionaries>

    You can check the attached project which demonstrates the solution.

    Note that this behavior is caused by a bug and we will do our best to fix it in some of the upcoming release.

    Regards,
    Neli
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  5. muhammad
    muhammad avatar
    4 posts
    Member since:
    Jul 2018

    Posted 27 Nov 2019 in reply to Neli Link to this post

    Thanks it works. I recomend this solution to anyone who have same problem, like me.
Back to Top