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

Prepare New Custom Window

This article shows how to prepare a custom instance of RadTabbedWindow to be used as a host when you drag out a tab item from its original window.

By default, when you drag a RadTabItem out of its parent tabbed window, a new RadTabbedWindow instance is created as the tab's host. You can use the PrepareNewWindow virtual method to customize the default instance or replace it with a custom implementation of RadTabbedWindow.

The following example shows how to create a class that derives from RadTabbedWindow and overrides the PrepareNewWindow, where it returns an instance of itself. This is useful when you need the newly created window to be the same type as the custom implementation.

Example 1: Override the PrepareNewWindow method

public partial class CustomTabbedWindow : RadTabbedWindow 
{ 
    protected override RadTabbedWindow PrepareNewWindow() 
    { 
        var window = new CustomTabbedWindow(); 
        return window; 
    } 
} 

Read more about RadTabbedWindow configuration in its Getting Started article.

See Also

In this article