Я пытаюсь загрузить два окна последовательно, но первое не загружается должным образом. В чем может быть причина? Блокирую ли я какой-либо поток рендеринга пользовательского интерфейса данными второго окна?
private void loadFormWithLoadingScreen()
where Type : Window, new()
{
//first step:
LoadingScreen loadingScreen = new LoadingScreen
{
Owner = this,
Topmost = true
};
this.Hide();
loadingScreen.Activate();
loadingScreen.Show();
loadingScreen.toCenter(this);
//second step:
Type win = new Type
{
Owner = this,
Topmost = true
};
win.Unloaded += (_s, _e) =>
{
this.Show();
this.Activate();
};
win.Loaded += (_s, _e) =>
{
loadingScreen.Close();
};
win.toCenter(this);
win.Show();
}
Подробнее здесь: https://stackoverflow.com/questions/784 ... quentially