Tracking layout changes within the Docking control

6 posts, 0 answers
  1. David
    David avatar
    7 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2011 Link to this post

    Hi,

    I'm wanting to know when any RadPane, SplitContainer, or Group changes size or location within the RadDocking control?  I'm wanting to know so I can advise the user to "save" the layout.

    I've looked at a few events on the Docking control but none seem to fire.

    Could someone please advise what events (either on the RadPane itself or the Docking control) I need to watch in order to do this?  BTW, I'm not really interested in what the change was, just that it effected the layout.

    Thanks,

    David
  2. David
    David avatar
    7 posts
    Member since:
    Oct 2012

    Posted 24 Oct 2011 Link to this post

    I've just realised (through another thread) that I have to hook into the SizeChanged event of the content within the RadPane which is fine, but I'd still like some advise on the Location of the RadPane within the Docking control and when it moves?
  3. DevCraft banner
  4. David
    David avatar
    7 posts
    Member since:
    Oct 2012

    Posted 25 Oct 2011 Link to this post

    Can anyone help, please?
  5. George
    Admin
    George avatar
    1332 posts

    Posted 26 Oct 2011 Link to this post

    Hello David,

    Thank you for contacting us.

    Yes, handing SizeChanged for the RadPane.Content element could suit your needs. Moreover, if you want to get the pane location (if it is docked, floating or unpinned) I would suggest using the RadDocking.PaneStateChangedEvent. For more information, please refer to the following link - http://www.telerik.com/help/silverlight/raddocking-events-overview.html


    Hope this helps.

    Regards,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  6. David
    David avatar
    7 posts
    Member since:
    Oct 2012

    Posted 02 Nov 2011 Link to this post

    Sorry, this isn't actally what I mean.

    If I move a floating pane from location 150, 200 to location 160, 300, how could I be made aware of this?  In this instance there is no size change to the pane only a location change within the RadDocking control.

    This is very important to know so to advise the user to save their layout.
  7. George
    Admin
    George avatar
    1332 posts

    Posted 07 Nov 2011 Link to this post

    Hi David,


    When a pane goes floating, it is placed in a ToolWindow. There could be only one pane in this toolwindow, but the user could dock more than one pane and then RadPane.SizeChangedEvent won't help, too. This is the reason I would suggest using the ToolWindow.SizeChangedEvent. Here is how you could handle the event:

    1. Handle the RadDocking.PaneStateChanedEvent
    2. If the RadPane(the RadRoutedEventArgs.OriginalSource) is floating, get the parent toolwindow and handle the SizeChanged event. Please, refer to the code snippet below:

    private void dock_PaneStateChange(object sender, RadRoutedEventArgs e)
    {
        var pane = e.OriginalSource as RadPane;
        if (pane.IsFloating)
        {
            var toolwindow = pane.GetParentToolWindow();
            toolwindow.SizeChanged += new SizeChangedEventHandler(toolwindow_SizeChanged);
        }
    }


    Hope this helps.


    Regards,
    George
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner