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

How to Use RadWindow as MainWindow

## Environment

Product Version 2019.1.220
Product RadWindow for WPF and Silverlight

## Description

How to Use RadWindow as MainWindow.

## Solution

1. First open the MainWindow.xaml file and replace the Window declaration with a RadWindow declaration:

<h4><strong></strong></h4><div class='tabbedCode'><pre lang='XAML'><code>  &lt;telerik:RadWindow x:Class="RadWindowAsMainWindow.MainWindow" &#13;      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" &#13;      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" &#13;      xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" &#13;      Header="MainWindow" Height="350" Width="525"&gt; &#13;  ... &#13;  &lt;/telerik:RadWindow&gt; &#13;</code></pre></div>
and in code-behind:

<h4><strong></strong></h4><div class='tabbedCode'><pre lang='C#'><code>  public partial class MainWindow : RadWindow &#13;  { &#13;   ... &#13;  } &#13;</code></pre></div>

2. Remove StartupUri from the Application definition inside App.xaml:

<h4><strong></strong></h4><div class='tabbedCode'><pre lang='XAML'><code>  &lt;Application x:Class="RadWindowAsMainWindow.App" &#13;      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" &#13;      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &#13;  ... &#13;</code></pre></div>

3. Then override the OnStartup method of the Application class to show the RadWindow:

<h4><strong></strong></h4><div class='tabbedCode'><pre lang='C#'><code>  public partial class App : Application &#13;  { &#13;      protected override void OnStartup(StartupEventArgs e) &#13;      { &#13;      new MainWindow().Show(); &#13;      base.OnStartup(e); &#13;      } &#13;  } &#13;</code></pre></div>

## See Also

In this article