Use WindowsInteropHelper with RadWindow

14 posts, 0 answers
  1. Phong
    Phong avatar
    1 posts
    Member since:
    Oct 2010

    Posted 04 Nov 2010 Link to this post

    Any ideas how to use WindowInteropHelper with the RadWindow?  WindowInteropHelper wants a Window.....

    private void ShowWindow(RadWindow window)
    {
        WindowInteropHelper helper = new WindowInteropHelper(window);
        helper.Owner = _windowHandle;
        window.Show();
    }

    Thanks,
    PT
  2. George
    Admin
    George avatar
    1332 posts

    Posted 09 Nov 2010 Link to this post

    Hi Phong,

    You could get and use the Window when the RadWindow is loaded. Here is the sample code:

    private void Button_Click(object sender, RoutedEventArgs e)
            {
                var myRadWindow = new RadWindow();
                myRadWindow.Loaded +=new RoutedEventHandler(myRadWindow_Loaded);
                myRadWindow.Show();
            }
     
            void myRadWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
            {
                System.Windows.Window window = System.Windows.Window.GetWindow(sender as RadWindow);
                if (window == null)
                {
                    return;
                }
     
                WindowInteropHelper helper = new WindowInteropHelper(window);
            }

    I hope this helps.

    Best wishes,
    George
    the Telerik team
    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 Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Stefan
    Stefan avatar
    1 posts
    Member since:
    Jan 2011

    Posted 21 Jan 2011 Link to this post

    Hi!

    I have the same problem, and i tried your solution...

    The problem is that i need the WindowsInteropHelper to set the Owner of my RadWindow, but if i do it in the Loaded event
    i get this exception:

    "Cannot set Owner property after Dialog is shown."

    Apparently i need to set the Owner before the Loaded event, but i can´t get my WindowsInteropHelper before that.

    Any suggestions?

    Thanks
    /Stefan E
  5. George
    Admin
    George avatar
    1332 posts

    Posted 26 Jan 2011 Link to this post

    Hello Phong,

     
    Unfortunately, when a RadWindow is created, it is placed in a Window control. There is no way to get the window before the LoadedEvent handler. This is a limitation of the RadWindow at this stage.

    We will definitely consider this scenario with the RadWindow control.

    Regards,
    George
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. Vladimir
    Vladimir avatar
    11 posts
    Member since:
    Oct 2010

    Posted 28 Nov 2012 Link to this post

    Same problem here. Trying to use RadWindow as host window for VisualStudio wizard. 

    It would be nice, if you implement event wich will be raised after back Window creation but before it shown. Usefull for System.Window tweaks.

    For example here:
    class WindowHostBase<br>
    {
    //...
     public virtual void Open(bool isModal)
        {
          WindowHostBase.hosts.Insert(this.FindIndexToAdd(), this);
          //<Raise event here>
        }
    //......
    }


    As i see it is generic method for all your host types(WindowWithNoChromeWindowHost / MockWindowHost / SinglePopupWindowHost).

    Or just here
    class WindowWithNoChromeWindowHost<br>
    {
    //...
    public override void Open(bool isModal)
    {
          this.PrepareHost();
          this.Host.Loaded += new RoutedEventHandler(this.OnHostLoadedForFirstTime);
          base.Open(isModal);
            //<Raise event here>
          if (isModal)
            this.Host.ShowDialog();
          else
            this.Host.Show();
    }
    //...
    }
    TaskBar display, title set and so one.
  7. Vladimir
    Vladimir avatar
    11 posts
    Member since:
    Oct 2010

    Posted 05 Dec 2012 Link to this post

    Any comments?
  8. George
    Admin
    George avatar
    1332 posts

    Posted 10 Dec 2012 Link to this post

    Hi Vladimir,

     
    I would say that this is a good suggestion which we logged in our PITS here - http://www.telerik.com/support/pits.aspx#/public/wpf/13710 and we will consider implementing it for our further releases. Also, I am glad to update your telerik points as well.

    Greetings,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  9. Vladimir
    Vladimir avatar
    11 posts
    Member since:
    Oct 2010

    Posted 08 May 2013 Link to this post

    It is sad that you ignoring feature requests update status. Also this FR is actual for WPF not for Silverlight
  10. George
    Admin
    George avatar
    1332 posts

    Posted 13 May 2013 Link to this post

    Hi Vladimir,

     
    The feature request is not ignored, it's logged in our backlog system and we will look into it in our further releases. If it gets more votes, we will scheduled it for recent release. Also, we believe that the request is valid for both platforms (WPF and SL) as well.

    All the best,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  11. Jason
    Jason avatar
    47 posts
    Member since:
    Jan 2013

    Posted 13 Mar 2015 in reply to George Link to this post

    I would vote for this .... if I could get to the ticket on the PITS system
  12. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 16 Mar 2015 Link to this post

    Hello Jason,

    We moved the items from the PITS to the Feedback portal. You can find the same item on the following link:
    http://feedback.telerik.com/Project/143/Feedback/Details/113558-add-event-which-is-raised-after-the-windowhost-creation

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  13. Vikas
    Vikas avatar
    36 posts
    Member since:
    Dec 2015

    Posted 25 Jan in reply to Kalin Link to this post

    Any updates on this?
  14. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 26 Jan Link to this post

    Hello Vikas,

    We currently working on implementing the feature. Once it is done, we will update the Feedback item with the exact version of the controls. So please stay tuned.

    If you have any other questions, please let us know.

    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
  15. Vikas
    Vikas avatar
    36 posts
    Member since:
    Dec 2015

    Posted 26 Jan in reply to Kalin Link to this post

    Thanks
Back to Top
UI for WPF is Visual Studio 2017 Ready