wpf - Showing and closing multiple windows -


say have 2 wpf windows. windowa , windowb. each window has 2 buttons. open button show other window , close button close other window (vice versa).

example windowa have following click event , sub

private sub button1_click(byval sender system.object, byval e system.windows.routedeventargs) handles button1.click        windowb.show()        closeweaidwindow()     end sub     public sub closeweaidwindow()         dim closewindow = window.getwindow(me)         if closewindow isnot nothing             closewindow.close()             gc.collect()         end if     end sub 

however closes entire application , not windowa. windowb opens .5 seconds.

how can open window , close current window?

sounds application.shutdownmode set onmainwindowclose. if want app remain open long window visible try onlastwindowclose.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -