WPF UI Thread High Utilization when using a Content Presenter to display a user control

298 views Asked by At

I'm using a content presenter to display a Dev Express Ribbon Control. The user control that is associated with the Data Template item is similar with the following code:

<DockPanel Grid.Column="2" Grid.Row="0">
                    <dxr:RibbonControl x:Name="ribbonControl1"
                                RibbonStyle="Office2010"
                                ToolbarShowMode="ShowAbove"
                                PageCategoryAlignment="Default"
                                ShowApplicationButton="False">
                        <dxr:RibbonControl.PageHeaderItems></dxr:RibbonControl.PageHeaderItems>
                        <dxr:RibbonDefaultPageCategory>
                           //etc etc etc ...
                           //etc etc etc ...
                        </dxr:RibbonDefaultPageCategory>
                    </dxr:RibbonControl>

The problem is that it takes a lot of time to render this User Control(around 5-6 seconds), but this happens only the first time, when I set the content presenter, the next runs will last significantly less.

I have attached a snippet from the Visual Studio UI Profiling Session: enter image description here

What is the best approach in this kind of situations?

0

There are 0 answers