New to Telerik UI for WPF? Download free 30-day trial

Closing

The RadWindow can be closed by either clicking on its 'Close' button at the top-right corner or by calling the Close() method of the RadWindow instance.

WPF RadWindow Close Button

Example 1: Closing a RadWindow

RadWindow radWindow = new RadWindow(); 
radWindow.Show(); 
//... 
radWindow.Close(); 
Dim radWindow As New RadWindow() 
radWindow.Show() 
'...' 
radWindow.Close() 

When the RadWindow gets closed, the Closed event is raised. More about events can be found here.

Prevent Closing

To disable the closing of the RadWindow via the UI you can set the CanClose property to False.

Example 2: Setting the CanClose property

RadWindow radWindow = new RadWindow(); 
radWindow.CanClose = false; 
Dim radWindow As New RadWindow() 
radWindow.CanClose = False 

WPF RadWindow Hidden Close Button

Alternatively, you can also handle the PreviewClosed event and set the Cancel property of the event arguments to True.

Example 3: Canceling the PreviewClosed event

private void RadWindow_PreviewClosed(object sender, WindowPreviewClosedEventArgs e) 
{ 
    e.Cancel = true; 
} 
Private Sub RadWindow_PreviewClosed(ByVal sender As Object, ByVal e As WindowPreviewClosedEventArgs) 
    e.Cancel = True 
End Sub 

See Also

In this article