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

Screen Coordinate for a floating RadPane

2 Answers 126 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 20 Sep 2012, 03:58 AM
Hi,

I need to get the screen coordinates for a floating RadPane so that I can determine which screen\monitor it is on.

Does anyone know the easiest way to get this value?

By the way remember I am using WPF and not WinForms.

Thanks heaps.

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 20 Sep 2012, 07:35 AM
What I am actually trying to do is float a docked RadPane and move it to a different monitor\screen.

Below is the code I have so far.  Any ideas why this is not working or how I should be doing this?

pane.MakeFloatingDockable();
var screen = System.Windows.Forms.Screen.AllScreens[1];
var content = (FrameworkElement)pane.Content;
var point = new Point(screen.WorkingArea.X, screen.WorkingArea.Y);
RadDocking.SetFloatingLocation(pane.PaneGroup.ParentContainer, point);
RadDocking.SetFloatingSize(pane.PaneGroup.ParentContainer, new Size(content.RenderSize.Width, content.RenderSize.Height));
0
Chris
Top achievements
Rank 1
answered on 20 Sep 2012, 12:34 PM
Just worked this one out. Need to use ToolWindow.

                        pane.MakeFloatingDockable();
                        var window = pane.GetParentToolWindow();
                        var screen = System.Windows.Forms.Screen.AllScreens[1];
                        if (window != null)
                        {
                            var content = pane.Content as FrameworkElement;
                            if (content != null)
                            {
                                window.Left = screen.WorkingArea.X;
                                window.Top = screen.WorkingArea.Y;
                                window.Width = content.Width;
                                window.Height = content.Height;
                            }
                        }
Tags
Docking
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Share this question
or