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

Multiple monitor set-up: Load RadPane after it being saved on a disabled or not available monitor

1 Answer 64 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Marius
Top achievements
Rank 1
Marius asked on 01 Mar 2017, 08:51 PM

Hi,

I'm working with RadDocking on a multiple monitor set-up. Let's consider the following scenario:

1. I open my application.

2. I have my View containing RadDocking on a monitor.

3. I drag a RadPane to another monitor.

4. I save the layout using a XML file.

5. I close my application.

6. I disable/unplug the monitor on which I've dragged the RadPane.

7. I open my application, load the layout from that XML and the dragged RadPane doesn't show.

Code-wise at this point, even though that RadPane isn't showing, it still exists and has content.

I'm using RadDocking_PaneStateChange() to get that RadPane and I'm using this to determine if it was saved on that disabled monitor:

 bool outOfBounds = (location.X <= SystemParameters.VirtualScreenLeft - screen.Bounds.Width) || (location.Y <= SystemParameters.VirtualScreenTop - screen.Bounds.Height) || (SystemParameters.VirtualScreenLeft + SystemParameters.VirtualScreenWidth <= location.X) || (SystemParameters.VirtualScreenTop + SystemParameters.VirtualScreenHeight <= location.Y);

 

Is there an inbuilt method that does this for me? If not, could you suggest a better approach, please? :)

 

Best regards,

Marius

1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 06 Mar 2017, 10:56 AM
Hi Marius,

There isn't built in functionality for achieving the desired. However what I can suggest you would be to use the ToolWindowCreated event of the RadDocking - you could get the ToolWindow from the arguments (e.CreatedElement) and change the Top and Left properties as needed.

private void OnToolWindowCreated(object sender, ElementCreatedEventArgs e)
{
    (e.CreatedElement as ToolWindow).Left = 0;
    (e.CreatedElement as ToolWindow).Top = 0;
}

Hope this helps.

Regards,
Kalin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Docking
Asked by
Marius
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or