[]
Gets or sets the dialog result for the window.
public MessageBoxResult DialogResult { get; set; }
Setting this property to a value other than "None" automatically closes the window. Clicking the "Close" button on the window caption bar sets DialogResult to Cancel and then closes the window.