Caliburn-Micro / Caliburn.Micro

A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
http://caliburnmicro.com/
MIT License
2.79k stars 776 forks source link

Activating / Deactivating Views with ListViews, ListBoxes etc. is very slow #621

Open Hanebu opened 5 years ago

Hanebu commented 5 years ago

I have 3 Views (ViewA, ViewB, ViewC) besides the ShellView, where I navigate to using MahApps.Metro Hamburger Menu.

However switching between ViewA and ViewB is very smooth. Those Views only contain a few Textblocks. If I navigate to ViewC, which contains 7 ListViews with multiple custom ListViewItems, the whole UI freezes for a couple of seconds. Depending on how many items there are to display. The UI even freezes when I switch from ViewC to ViewA or ViewB.

So my guess is, that the rendering of the ListViewItems takes a long time, but why does "leaving" the screen also freeze the UI? What am I doing wrong? I have no idea in which direction I should go...

I made a repo which shows this behaviour. Click me. I greatly appreciate all input and help.

vb2ae commented 3 years ago

I profiled the demo app you uploaded to see where the slowness was coming from.

NumericUpDown

it appears the slowness is coming from the rendering of the xaml. I tried changing the numeric up downs to textblocks and performance improved greatly.

TextBlock

I did try the wpf toolkits integer updown instead of the one used in the sample the performance was not bad. I did not profile it.