Cannot implicitly convert type RadWindow to Window

7 posts, 1 answers
  1. Sergiy
    Sergiy avatar
    38 posts
    Member since:
    Jan 2012

    Posted 13 Sep 2012 Link to this post

    Hello, I have got RadWindow created in xaml.
    When I try to create this Rad window in code

                    var mainWindow = new MainWindow(); // IT'S RADWINDOW
                    Application.Current.MainWindow = mainWindow;
                    Close();
                    Application.Current.MainWindow.Show();

    I have an error as:
    Cannot implicitly convert type 'SomeProjectName.SomeFolder.MainWindow' to 'System.Windows.Window'

    How to solve this problem?
  2. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 13 Sep 2012 Link to this post

    Hello Sergiy,

    Please check the following kb article which demonstrates how you can use RadWindow as main Window in WPF:
    http://www.telerik.com/support/kb/wpf/window/radwindow-as-main-window.aspx

    Also the approach is discussed in details in the following forum thread:
    http://www.telerik.com/community/forums/wpf/window/radwindow-as-mainwindow.aspx 

    Kind regards,
    Yana
    the Telerik team

    Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Ron
    Ron avatar
    1 posts
    Member since:
    Oct 2012

    Posted 13 Dec 2012 Link to this post

    I'm having the same issue. The RadWindow cannot be used as a typical Window object. These referenced links only show how to set up the RadWindow, not how to use the RadWindow as a Window object in the code-behind.  Can someone please answer how to use the RadWindow as a Window object in the code-behind?
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 18 Dec 2012 Link to this post

    Hi Ron,

    Currently this is the only way to use RadWindow as main Window that we provide. Could you please explain in more details the issues you're experiencing with the approach?

    Regards,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Anatoliy
    Anatoliy avatar
    37 posts
    Member since:
    Oct 2012

    Posted 11 Feb 2013 Link to this post

    I have the same Exception with using WPF + MEF... RadWindow can't be converted in Bootstraper:
    protected override void InitializeShell()
            {
                base.InitializeShell();
                Application.Current.MainWindow = (Window) Shell;
                Application.Current.MainWindow.Show();
            }

    Waiting for some advises!

    Best regards, Anatoliy
  7. Sueleyman
    Sueleyman avatar
    6 posts
    Member since:
    Nov 2015

    Posted 13 Nov 2015 in reply to Anatoliy Link to this post

    Hi Anatoliy,

     did you find a soultion for this ?

  8. Kalin
    Admin
    Kalin avatar
    1208 posts

    Posted 16 Nov 2015 Link to this post

    Hello Sueleyman,

    Please find attached a sample project demonstrating how to use RadWindow as MainWindow in a PRISM 5 application.

    Hope this helps.

    Regards,
    Kalin
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WPF is Visual Studio 2017 Ready