# Working with RadWindow

This topic will explain you how to work with the **RadWindow** in details.

## Create a RadWindow

In order to use the **RadWindow** in your application you have to add a reference to the **Telerik.Windows.Controls.Navigation** assembly in your project.

After the reference is available, you can declare a **RadWindow**. Here is an example.

```C#
RadWindow radWindow = new RadWindow();
radWindow.Width = 400;
radWindow.Height = 300;
```

```VB.NET
	Dim radWindow As New RadWindow()
	radWindow.Width = 400
	radWindow.Height = 300
```

## Show the RadWindow

When you want to display the **RadWindow** you have two options - to display it as a **window** or as a **modal dialog window**.

> tip To learn more about modal windows read [here](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/modal-windows).

Call the **Show()** method of the **RadWindow** instance to open it as a **normal window**.

```C#
radWindow.Show();
```

```VB.NET
	radWindow.Show()
```

Call the **ShowDialog()** method of the **RadWindow** instance to open it as a **modal dialog window**.

```C#
radWindow.ShowDialog();
```

```VB.NET
	radWindow.ShowDialog()
```

![WPF RadWindow Shown As Modal Dialog](https://www.telerik.com/products/wpf/documentation/assets/7700027d7f15dd97d3f8311aeadf5f13/radwindow_working_with_radwindow_01.png)

> tip Learn more about positioning the **RadWindow** by reading the [Positioning](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/positioning) topic.

## Add content to the RadWindow

To add a content to the **RadWindow** you can use either the **Content** or the **ContentTemplate** properties.

If you have a window-specific content, use the **Content** property.

> tip As the **Content** property is of type object you can set it to any control you like. If you want to have a more complex content that consists of more than one control, be sure to wrap them inside a layout control and pass the layout control as content.You can also set the content of the **RadWindow** to a **UserControl**.

> The only scenario, where you can add content to the **RadWindow** at design-time, is when the **RadWindow** represents an entire user control. To learn more about that read [here](https://www.telerik.com/products/wpf/documentation/controls/radwindow/how-to/use-radwindow-as-user-control).

```C#
Grid grid = new Grid();
grid.Background = new SolidColorBrush(Color.FromArgb(255, 240, 255, 255));
radWindow.Content = grid;
```

```VB.NET
	Dim grid As New Grid()
	grid.Background = New SolidColorBrush(Color.FromArgb(255, 240, 255, 255))
	radWindow.Content = grid
```

If you want to share a common layout structure for the content of multiple windows, define an appropriate **DataTemplate** and set it to the **ContentTemplate** property of the **RadWindow**.

```XAML
<DataTemplate x:Key="WindowContentTemplate">
    <Grid Background="Azure" />
</DataTemplate>
```

```C#
radWindow.ContentTemplate = this.Resources["WindowContentTemplate"] as DataTemplate;
```

```VB.NET
	radWindow.ContentTemplate = TryCast(Me.Resources("WindowContentTemplate"), DataTemplate)
```

![WPF RadWindow Custom Content Template](https://www.telerik.com/products/wpf/documentation/assets/04f42540d44edc1031d4a330ae7fba3b/radwindow_working_with_radwindow_02.png)

## Program the RadWindow

The **RadWindow** exposes a few methods, that allow you to programmatically control its behavior. Here is a list of them:

* **BringToFront**: Attempts to bring the **RadWindow** over any other **RadWindows** except topmost.

* **Close**: Closes the **RadWindow**.

## Modify the appearance of the RadWindow

To modify the default appearance of the **RadWindow** you can use the following properties:

* **BorderBrush**: Changes the outer border of the **RadWindow** and the outer border of its content area.

* **Background**: Changes the background of the content area.

* **CaptionHeight**: Gets or sets the height of the extent of the top of the window threatened as the caption.

* **CornerRadius**: Gets or sets a value that represents the degree to which the corners of the window are rounded.

Also you can create a style and apply it to the **RadWindow** or modify the default template of the **RadWindow** to change its overall look. To learn more read the [Styles and Templates](https://www.telerik.com/products/wpf/documentation/controls/radwindow/styles-and-templates/styling-the-predefined-windows) section.

## See Also

* [Visual Structure](https://www.telerik.com/products/wpf/documentation/controls/radwindow/visual-structure)
* [Events](https://www.telerik.com/products/wpf/documentation/controls/radwindow/events-overview)
* [Predefined Dialogs](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/predefined-dialogs)
* [RadWindowManager](https://www.telerik.com/products/wpf/documentation/controls/radwindow/features/radiwindowmanager)
