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

Reporting Control themes effect my Micrsoft WPF Controls in Project

4 Answers 132 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
muhammad
Top achievements
Rank 1
muhammad asked on 07 Nov 2019, 12:11 PM

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

 

 

 

 

4 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 12 Nov 2019, 11:35 AM

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
0
muhammad
Top achievements
Rank 1
answered on 22 Nov 2019, 03:26 PM
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.
0
Accepted
Neli
Telerik team
answered on 26 Nov 2019, 12:03 PM

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
0
muhammad
Top achievements
Rank 1
answered on 27 Nov 2019, 07:27 AM
Thanks it works. I recomend this solution to anyone who have same problem, like me.
Tags
General Discussions
Asked by
muhammad
Top achievements
Rank 1
Answers by
Neli
Telerik team
muhammad
Top achievements
Rank 1
Share this question
or