Owner property

4 posts, 0 answers
  1. Xin
    Xin avatar
    6 posts
    Member since:
    Nov 2010

    Posted 08 Jun 2012 Link to this post

    Hi:

    I tried to set RadWindow.Owner to a Widnow,

    this

     

     

    .Owner = Application.Current.MainWindow;

     


    but it is said
    Error 1 Cannot implicitly convert type 'System.Windows.Window' to 'System.Windows.Controls.ContentControl'.

    Is there a way to set Owner property to a Window?
    Could anyone help me with this one?

    Thanks
    Xin
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 12 Jun 2012 Link to this post

    Hi,

    The Owner property should be set to a ContentControl, for example:

    this.Owner = Application.Current.MainWindow.Content as ContentControl;


    Kind regards,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Xin
    Xin avatar
    6 posts
    Member since:
    Nov 2010

    Posted 12 Jun 2012 Link to this post

    Hi Konstantina:
     
    Thanks for your reply.
    But when I tried your code, it said:
    'System.Windows.Window' do not contain a definition for 'Content' and no extension method accepting a first argument of type 'System.Windows.Window' could be found.

    How can I correct it?

    Regards
    Xin
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 13 Jun 2012 Link to this post

    Hi Xin,

    Sorry for the misunderstanding.

    The Owner property in Silverlight is not designed to point which out-of-browser Window will be the owner, but which RadWindow will be owner of the newly created one. Also, even if set to a RadWindow it will only close the owned window, but not set its Z index. This is how the property is designed. This issue is logged in PITS - you could view it here, vote for it and track its status. It is logged under the RadDocking control, but the concern is the same.

    Hope this information helps.

    All the best,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top