Question: wpf how to close a window?
Answer: window. ShowDialog(); Close method of the Window class is used to close a window. The following code snippet calls the Close method to close a window.