For loop: open window, wait until it is closed, then progress to the next step in the for loop


New member
Feb 5, 2021
Programming Experience
I am working with RelayCommands and a MessageBus.

I want to write a learning program. I have three windows:

1. Learning Tab -> Here I choose which List of Cards I want to learn and here I think I should write the for loop
2. Question -> The first question of the list of cards I gave to the for loop comes here; I answer the question which opens the answer window
3. Answer -> In this window my answer is shown ... then I want to open the next Question window witht he next question until the last question is answered and then it goes back to Learning Tab

I know how to open the window etc ... but I don't know how to make it wait for the next question


Staff member
Apr 6, 2019
Chesapeake, VA
Programming Experience
There is a difference between procedural programming and event driven programming. What you are trying to do above is procedural programming and not compatible with WPF (and most other GUI frameworks) which are event driven. You need to think in an event driven way and restructure your code. What you want will be a simple state machine.
Last edited:
Top Bottom