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

2 posts, 0 answers
  1. Marius
    Marius avatar
    1 posts
    Member since:
    Mar 2017

    Posted 01 Mar 2017 Link to this post

    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

  2. Kalin
    Admin
    Kalin avatar
    1360 posts

    Posted 06 Mar 2017 Link to this post

    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.
Back to Top