I am creating a WPF MVVM Application where I have a Main Window and different Pages displayed in a Frame. I want to add a Loading Screen with a Progress Bar which updates while the Instances for the Pages get created:
Dim customer_page as new Pg_Custommer
Because there are Databases in some Pages, which get read while creating a new Instance, this takes some Time. I have tried to solve this with a Background Worker, but this did not work because the Thread has no Access to GUI (no STA-Thread). I need a Way to update the Progress Bar after each Class gets loaded.
Maybe someone could tell me how to solve this with a Dispatcher(No idea how these work) or similar.
Thanks in advance and Greetings from Switzerland
The SplashScreen ist a WPF Form with just Code behind, no VMMW, for testing. So i can adress the Progress Bar Value directly.
This is my Example Code:
It Runs now like this, but still the Page freezes and Progress Bar gets updated after all Classes are instantiated.
I guess im making a very stupid mistake somewhere but i just cant find it.