C
C
crescent2017-05-25 09:56:38
WPF
crescent, 2017-05-25 09:56:38

Error opening wpf form?

There is an application in which a bunch of windows form
And I added one wpf form there.
I call them two in sequence
new WpfForm().showDialog();
new WpfForm().showDialog();
Those first opens, I close it and opening the second.
But when opening the second one, an error occurs in the place of InitilizeComponent ()
Here is the picture:
8170ba87e87243f2b23b4d937892143d.png
Great gods of Ktun, solve this problem!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2017-05-25
@Sumor

Most likely, you have the Application object you are creating set to close the application when the last form is closed.
Your first form closes and at that moment Application sees that there are no more forms - it closes itself. And you immediately try to create and run a new form.
Set Application.Current.ShutdownMode to OnExplicitShutdown

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question