I am using the savelayout and loadlayout functions to save and load dock layout. This is working as expected.
The issue I'm having is where I should put the loadlayout code in the page lifecycle.
If I add the load function to the constructor as expected the layout is ignored and the default is used. If I add the load function to the contentrendered code the user see's the dock jerk from one layout to another.
Ideally I don't want the user to see the move from default to loaded layouts.
Can you explain how I achieve this please?
Many thanks
R
4 Answers, 1 is accepted
The constructor of the parent user control or window would normally be the best place to load the layout.
I've prepared a small sample project where doing so correctly loads the last-saved layout at my end.
Could you please have a look and let me know how this project differs from the setup at your end?
I will be looking forward to your reply.
Regards,
Dilyan Traykov
Progress Telerik
Dilyan,
Many thanks for your reply and the attached sample. Your sample is almost verbatim the method I've tried in my project. I think the issues stem from the fact I have 8 or 9 radpanes all with radgridviews/toolbars/buttons etc. in them. I think it's simply a case of WPF not drawing the screen quick enough?
Not sure what to do next?
Regards,
Rob
I tried to add more panes to the setup but the LoadLayout still works as expected at my end. Would you find it possible to replicate the issue in the sample project I provided and send it back to me?
I can also suggest trying to invoke the method via the Dispatcher, if you believe that it is due to a timing issue:
public
MainWindow()
{
InitializeComponent();
Dispatcher.BeginInvoke(
new
Action(() =>
{
this
.LoadLayoutFromFile();
}), DispatcherPriority.Render);
}
Please let me know how this goes.
Regards,
Dilyan Traykov
Progress Telerik