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

Save layout on PaneStateChanged

3 Answers 58 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 16 Nov 2012, 09:26 AM
Hi,

I am trying to implement a feature for load/save named docking layouts like you have in Team Pulse demo for grids.

1. I have a dropdown with the list of available layouts like "default", "view 1", "view 2", "custom".
2. Initially I save default layout.
3. I subscribe to docking PaneStateChanged and all panes SizeChanged and create/modify "custom" layout. 
4. You can rename current "custom" layout for later usage.

The issue I found is that when I save layout in PaneStateChanged, affected pane gets into layout xml only if it's in floating state. If I dock a pane in some pane group, group.EnumeratePanes() doesn't return my pane. That's why it doesn't get into layout xml.

This is a bug or by design? 

Please advise how I can get it working.

PS. I found a post where you suggested using LayoutUpdated event but I don't think this is good idea. Any mouse move causes layout updates.

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 21 Nov 2012, 10:12 AM
Hi Dmitry,

Please, note that when closing a pane, the PaneStateChanged won't be fired. In this case I would suggest handling the RadDocking.Close event. The PaneStateChanged event will be fire when a pane is pinned, unpinned and floated and docked.

We tested the given scenario and we truly found a bug that the docking layout is not saved correctly on PaneStateChanged when a floating pane is docked into a group. We logged it in our PITS and you could vote for it and track its progress here - http://www.telerik.com/support/pits.aspx#/public/silverlight/13531

I would suggest saving the Docking layout on a closing the application, for example. The PaneStateChanged is not the best point for saving, because the docking will not save the correct position of the ToolWindows (when a ToolWindow is moved, the PaneStateChanged won't be fired).

Greetings,
George
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Dmitry
Top achievements
Rank 1
answered on 21 Nov 2012, 02:42 PM
Thank you, George.

I've found some kind of workaround in my use case. I use PaneStateChanged and SizeChanged event just to know than something has changed in layout. Actual layout save is triggered by a user's action (button click). Now all necessary info about docking is present.

Btw, I'd suggest to think on a feature like "smart" restore layout or enable points for extension. We use PRISM with docking, regions are defined on PaneGroups. Docking can have different number of active views (panes). Once the layout is saved, only loaded panes are presented in layout xml. While restoring, I can have different number of panes in docking, less or more. With default implementation this gives errors or loses panes absent in layout xml. But it's possible to have it always working. You can restore panes in containers by checking serialization tag or something , if a pane is missing in layout xml

Currently this is possible only via layout xml modification and dynamic panes manipulation.

0
Vladi
Telerik team
answered on 26 Nov 2012, 08:08 AM
Hi Dmitry,

Thank you for your feedback.

We are constantly trying to improve RadDocking control and may consider using some of your suggestions for the save layout feature.

All the best,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Dmitry
Top achievements
Rank 1
Answers by
George
Telerik team
Dmitry
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or