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

Use WindowsInteropHelper with RadWindow

13 Answers 824 Views
Window
This is a migrated thread and some comments may be shown as answers.
Phong
Top achievements
Rank 1
Phong asked on 04 Nov 2010, 06:03 PM
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

13 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 09 Nov 2010, 12:40 PM
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
0
Stefan
Top achievements
Rank 1
answered on 21 Jan 2011, 01:24 PM
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
0
George
Telerik team
answered on 26 Jan 2011, 10:16 AM
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>>
0
Vladimir
Top achievements
Rank 1
answered on 28 Nov 2012, 02:15 PM
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.
0
Vladimir
Top achievements
Rank 1
answered on 05 Dec 2012, 07:48 AM
Any comments?
0
George
Telerik team
answered on 10 Dec 2012, 01:03 PM
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.

0
Vladimir
Top achievements
Rank 1
answered on 08 May 2013, 07:51 AM
It is sad that you ignoring feature requests update status. Also this FR is actual for WPF not for Silverlight
0
George
Telerik team
answered on 13 May 2013, 08:02 AM
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.

0
Jason
Top achievements
Rank 1
answered on 13 Mar 2015, 10:44 AM
I would vote for this .... if I could get to the ticket on the PITS system
0
Kalin
Telerik team
answered on 16 Mar 2015, 07:55 AM
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.

 
0
Vikas
Top achievements
Rank 1
answered on 25 Jan 2016, 09:13 PM
Any updates on this?
0
Kalin
Telerik team
answered on 26 Jan 2016, 09:32 AM
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
0
Vikas
Top achievements
Rank 1
answered on 26 Jan 2016, 01:44 PM
Thanks
Tags
Window
Asked by
Phong
Top achievements
Rank 1
Answers by
George
Telerik team
Stefan
Top achievements
Rank 1
Vladimir
Top achievements
Rank 1
Jason
Top achievements
Rank 1
Kalin
Telerik team
Vikas
Top achievements
Rank 1
Share this question
or