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

CreateShell Method Can't Return RadWindow in Prism 7

Environment

Product Version 2019.1.220
Product RadWindow for WPF

Description

Returning object of type RadWindow in the Prism 7 application CreateShell method causes an error.

Solution

Return null in CreateShell() method, and override OnInitialized() method to show the RadWindow.

public partial class App 
{ 
    protected override Window CreateShell() 
    { 
        return null; 
    } 
    protected override void OnInitialized() 
    { 
        // TelerikShell derives from RadWindow 
        TelerikShell shellWindow = Container.Resolve<TelerikShell>(); 
        shellWindow.Show(); 
        MainWindow = shellWindow.ParentOfType<Window>(); 
 
        RegionManager.SetRegionManager(MainWindow, Container.Resolve<IRegionManager>()); 
        RegionManager.UpdateRegions(); 
        InitializeModules(); 
        base.OnInitialized(); 
    } 
    protected override void RegisterTypes(IContainerRegistry containerRegistry) 
    { 
 
    } 
} 
In this article