I have a ListView
based control.
It's a file explorer.
When Path
property is set, first all file system items are loaded by asynchronous method (using Win32 API).
This is super fast even for large number of files. Anyway, for C:\Windows\System32 I don't see any lag.
The items are then added to my ListView
in batches of 64, after each 64 Dispatcher.Yield()
is awaited to show what was added before the operation finishes. This again makes the whole thing way faster and more responsive.
There is however one not very fast operation: when I need an icon for a file for the first time, I have to make a system call. This call is made in getter, it's smart, it tries to use cache if available.
The loading of the view is a blink.
However when I load a huge directory (no problem, fast) - and then resize or maximize the window - I see some black flash before the control resizes.
It's like first the window resizes, the added space is painted black, then the larger ListView
appears. It's supper annoying and like devastates my smooth experience. Is there any way to avoid this black space?
I tried to set Window
background to white, didn't help. I tried to set my UserControl
containing ListView
background to white. No joy.
When there are not many items in the ListView
there is no black flash, but it's still not smooth enough.
So - how to prevent seeing a black background while the control is being resized?