This is a migrated thread and some comments may be shown as answers.

Cannot convert type RadWindow to Window

2 Answers 149 Views
Window
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 23 Sep 2018, 06:18 PM

Hi,

Based on this ( https://www.telerik.com/forums/cannot-implicitly-convert-type-radwindow-to-window )

i tried to get the HostWindow in an mvvm + prism with prismapplication.

But it failed in CreateShell() the Shell is a RadWindow and is created but there is no HostWindow retuned and so it will not work.

Maybe because in PRism the changed the return Type to Window ( i think it was DependencObject before ) 

but so what can i do to return the Shell here ? 

thanks br

thomas

 

protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
    containerRegistry.RegisterSingleton<ShellWindow>();
}
 
protected override Window CreateShell()
{
    var shellwin = Container.Resolve<ShellWindow>();
    var appwin = Window.GetWindow(shellwin);
    return appwin;
}

 

2 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 26 Sep 2018, 02:08 PM
Hello Thomas,

Indeed it seems that the return type of the CreateShell method is changed which does not allow for returning a RadWindow. That said, you can check out the Do not require Window as base type for Shell github issue for a possible approach that you can use in the described scenario.

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Thomas
Top achievements
Rank 1
answered on 27 Sep 2018, 08:56 AM
thanks a lto it works now.
Tags
Window
Asked by
Thomas
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Thomas
Top achievements
Rank 1
Share this question
or