Answer the question
In order to leave comments, you need to log in
Best practices for opening a window in WPF?
What is the best way to open windows in WPF???
the bottom line is that I need to open 3 different windows one after the other,
for example, now I call the window like this
var propPage = new SomeWindow(IEnumerable<Properties> items);
var openResult = propPage.ShowDialog();
if (openResult.HasValue && openResult.Value)
//DoSomething
var propPage1 = new SomeWindow(IEnumerable<Properties> items);
var openResult = propPage1.ShowDialog();
if (openResult.HasValue && openResult.Value)
{
var propPage2 = new SomeWindow(IEnumerable<Properties> items);
openResult = propPage2.ShowDialog();
if (openResult.HasValue && openResult.Value)
{
var propPage3 = new SomeWindow(IEnumerable<Properties> items);
openResult = propPage3.ShowDialog();
if (openResult.HasValue && openResult.Value)
{
//DoSomething
}
}
}
Answer the question
In order to leave comments, you need to log in
The code is normal, you have not seen Java, well, if you want to get rid of unnecessary block nesting, use IF-NOT-RETURN.
Nothing is removed while in use, then the garbage collector removes it.
I recommend using a dependency container, such as Autofac, more details with examples can be found here
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question