Reputation: 657
I'm building a multi-window app. The problem I've got, I can't close "Window1" or "Window2" from button in "MainWindow". All windows are in the same app. Is there a way to kill another window?
Upvotes: 0
Views: 1106
Reputation: 12846
Sure there is. If you have a reference to that Window, just call the Close() method.
Window
Close()
Window window1 = new Window1(); window1.Show(); ... window1.Close();
Upvotes: 4