2

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?

Radu Olteanu
  • 393
  • 4
  • 17
  • The control loads and parses a lot of resources first time it is being displayed. That has to be done in the UI thread unfortunately. This is a general problem in a WPF app. There is no ideal solution for that. As a workaround, you could show a splash screen using a background thread and force your main window to load (being invisible). – dymanoid Sep 11 '17 at 14:19
  • 10x, that is what I did. – Radu Olteanu Sep 13 '17 at 13:33

0 Answers0