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

RadDock LoadLayout RadPane Header Being Overwritten

3 Answers 21 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Brian Sayatovic
Top achievements
Rank 1
Brian Sayatovic asked on 21 May 2014, 04:41 PM
I'm loading a saved RadDock layout and finding my Header values to be broken.

I'm hooking into ElementLoading (and ElementLoaded, but the latter just for diagnostics) so that I can create the RadPane for the AffectedElementSerializationTag myself.  When I create the RadPane, I set its Content, Header and Title.  The Content is another UserControl.  The Header is set to a custom object (class name "RegisteredPane"), and the Title is set to the same object.  I have a custom HeaderTemplate and TitleTemplate that data bid to the RegisteredPane objects.

After I construct my RadPane in ElementLoading, the Header (and Title) are set properly.  When ElementLoaded is invoked, I am handed the RadPane I just constructed and the Header (and Title) are still correct.  But by the time it's display, my Header (and Title) are replaced with a string that is the ToString() of my RegisteredPane class.

I suspect that after the ElementLoading/ElementLoaded phase of LoadLayout, RadDock is setting the previously saved Header (and Title) values, which, since they were objects, were serialized to just strings when being saved.

What can I do to interfere/pre-empt/prevent this behavior?

3 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 23 May 2014, 01:59 PM
Hello Brian,

When RadDocking saves its layout, it doesn't persists the value of the bound properties. For example, if the RadPane.IsHidden property is bound, it doesn't persists its value in the xml in order to not break the binding when loading. However, if a property is not bound but set, it's expected to save the object as string in the xml and load its value later. Can you try to bind the Header/Title property of the pane?

Hope this helps.


Regards,
George
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Brian Sayatovic
Top achievements
Rank 1
answered on 14 Jun 2014, 01:06 PM
I posted in the support ticket, but never heard back, so I'll post here as well:

Since I posted that, I stepped through as best I could.  I found that my Header properties are the right objects when I created them in ElementLoading, and also in ElementLoaded.  I believe it is somewhere between DockingLayoutFactory's LoadPaneGroup and its calls to LoadPane that my headers get replaced.

I came to this conclusion this by setting an object identifier on my pane, adding it as a watch variable, and then stepping out of the call stack one call at a time, up through the Telerik code I couldn't see, until I saw my value change from my object to just a string.  It seemed to be after the call returned from LoadPane but before I stepped out of LoadPaneGroup.

My bigger goal is to be able to save/restore pane layouts for our application that we're refactoring to use RadDocking as the centerpiece for.  Our code is abstracted away from the RadDocking framework, so we have some glue in-between that ties our abstractions to the concrete RadPane's being created.  As part of that, we have an object that logically represents the panes, including a title string and an icon (and possible additional information in the future) and we're setting a HeaderTemplate that has bindings against properties expected in that object.  When the Header is replaced by the string, the bindings break and we get the fallback values.
0
George
Telerik team
answered on 17 Jun 2014, 03:09 PM
Hi Brian,

Can you send us a sample project so we can reproduce the behavior on our side? Please, note that creating new panes in ElementLoading when they already are saved in the xml is not straight-forward and expected. Can you upload the project in the support ticket? This will help a lot and it will shed some light on the described scenario.

I am glad to assist you further.

Regards,
George
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Docking
Asked by
Brian Sayatovic
Top achievements
Rank 1
Answers by
George
Telerik team
Brian Sayatovic
Top achievements
Rank 1
Share this question
or