There is an application. First start. Authorization
The main window understands that there is no saved data and displays an authorization window. The main window is not even displayed yet.
After entering the login / password in the authorization form, she sends a request to the server and receives a token.
After receiving the token, the second window closes and returns control to the main one. Authorization takes place in a split second.
But after authorization to the server, you need to send a second request to receive a collection of data and subsequently transfer them to the database. All this must be done before the main form is displayed to the user.
This request has been running for 5 seconds and longer, depending on the amount of data received.
After authorization and transfer of control to the main window, it is necessary to immediately display the Splash screen to the user (a pretty window with information about progress), and execute the request in a separate thread.
When the request is completed, close the Splash screen and return control to the main one for displaying and working with it directly.
The main window cannot be displayed before receiving the data, because all of the displayed information will be taken from the information received on request. Without it, this is a bare pattern that the user does not need to see.
The problem is that I have no experience developing multi-threaded applications, so I would like to hear tips from a knowledgeable audience.
How to do this correctly?
Additional information: during the second and next program launches, it will take the authorization data from the saved properties ( Property.Settings.Default ), and the data for display in the main window will take from the local database files into which the data query results will be cached.
Afterwards, the program will, at a certain interval, launch in a separate thread a request for updating data in the local database and updating the information displayed in the window.