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

Slow performance with implicit styles

1 Answer 429 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vikas
Top achievements
Rank 1
Vikas asked on 29 Jun 2016, 08:13 PM

I am seeing some significant performance problem when using implicit styles that are marked as resource (build action).

Opening a dialog takes 5 second when the xaml (fo ex: Telerik.Windows.Controls.Data.xaml) files are marked as resource for build action, if i mark them as page the dialog opens up in a second.

I am developing and add-in project, basically my project is being hosted inside another WPF application, because of that I do not have an App.xaml file. I am referencing to no xaml binaries and have added all the telerik xaml files to my project.

Because I do not have app.xaml I am merging the xaml files in my dialog window. Not sure if this will cause the performance issue.

<Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../../Themes/Custom/Common.xaml"/>
                <ResourceDictionary Source="../../Themes/Custom/RadTabControlStyle.xaml"/>
                <ResourceDictionary Source="../../Themes/Custom/RadButtonStyle.xaml"/>
                <ResourceDictionary Source="../../Themes/Custom/RadTimePickerStyle.xaml"/>
                <ResourceDictionary Source="../../Themes/Custom/RadMaskedNumericInputStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <conv:EnumDescriptionConverter x:Key="enumDescriptionConverter"/>
            <conv:EnumFilterConverter x:Key="enumFilterConverter"/>
            <conv:ReverseBooleanConverter x:Key="reverseBooleanConverter"/>
        </ResourceDictionary>
    </Window.Resources>

 


 

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 30 Jun 2016, 06:02 AM
Hello Vikas,

It is possible the slow performance to be caused because you set build action to the Resource. The difference between Page and Resource is that when Page build action is set, the Xaml is compiled to Baml first. BAML form is an optimized form of XAML used by the WPF XAML implementation. It is optimized in the sense that it uses internal lookups and tokens for commonly used types or members. The optimization is useful as an implementation detail that addresses packaging size and load time for WPF application scenarios that involve XAML.

That is why, contrary to our help,  I would suggest to use Page build action instead of Resource one. Another solution is to reference your themes from the theme assemblies directly.

I hope this helps.

Regards,
Masha
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
Vikas
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or