Catel WPF - Lag when changing screen

56 views Asked by At

I'm using Catel in my application and I have problem with changing screens.

I have a ribbon navigation and a ContentPresenter for a screen. When I click ribbon button, I change ActiveView property in my ViewModel

It looks like this:

<ContentPresenter Margin="5 5 5 0" Content="{Binding ActiveView, Converter={StaticResource ViewModelToViewConverter}}" />

ActiveView is a ViewModel of my UserControl for specific view.

The problem is, that everytime I change screen (click ribbon button), I have a lag ~100ms which is very irritating.

I have also tried with DataTemplates for ContentPresenter, but there is no Performance boost with it.

Is there a way of boot performance of this? Maybe a way to pre-construct view, and then only show it? (because right now View is being constructed everytime I click a ribbon button)

Of course I'm checking it on Release build (on debug there is much more lag) :)

1

There are 1 answers

0
Geert van Horrik On

Please check the performance considerations in the docs. A few hints:

  1. Have you tried without a debugger attached?
  2. Are there log listeners doing a lot of work?
  3. Enable Api cop to see what features you are not using but are taking time. Then you can disable them.

Probably it's the control looking for the InfoBarMessageControl (which you can simply disable).