Slow performance with implicit styles

2 posts, 0 answers
  1. Vikas
    Vikas avatar
    37 posts
    Member since:
    Dec 2015

    Posted 29 Jun 2016 Link to this post

    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.

                    <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"/>
                <conv:EnumDescriptionConverter x:Key="enumDescriptionConverter"/>
                <conv:EnumFilterConverter x:Key="enumFilterConverter"/>
                <conv:ReverseBooleanConverter x:Key="reverseBooleanConverter"/>



  2. Masha
    Masha avatar
    355 posts

    Posted 30 Jun 2016 Link to this post

    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.

    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top