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

LoadLayout() localization issue

1 Answer 46 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 24 Nov 2015, 02:29 PM

I was trying to figure out why the titles of my RadPanes were not being translated.  I finally figured out that the LoadLayout() also loads the header of the panes and that overrides my XAML's {x:Static properties:Resources.xxx}.

I could say "After the LoadLayout(), change the title of each pane according to the resource strings" but it would be nice if it could be done directly in the XAML.  I don't believe there's a way to prevent the "Header" tag from being included in the SaveLayout/LoadLayout functions, right?  To tell you the truth, I don't even see why the header is included at all!

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Vladi
Telerik team
answered on 27 Nov 2015, 09:47 AM
Hello Pierre,

Thank you for contacting us.

By design in the current version of the RadDocking control when its SaveLayout built-in functionality is used only the most important properties of the each element are persisted. There are couple of exceptions to this persistence mechanism and one is when a binding is used for a specific property. In such cases that property is not persisted as it could lead to a binding expression that the RadDocking cannot resolve. As such values should come from the ViewModel rather that the View (the RadDocking control) after loading the layout you will need to restore the bindings manually. The same goes for the content of the RadPane instances, you can take a look at this article from our documentation that goes in deeper details on this case. There are also scenarios where the value of a property is directly persisted, this happens when a property (for example the Header) is set to a string. This is why when using static localization by setting the "{x:Static properties:Resources.xxx" that value is persisted by the SaveLayout functionality. Because this declaration of the property directly sets a string to the RadPane's Header the control's SaveLayout functionality saves its value. In order to resolve such scenario you could rather than statically set the Header property in the XAML, create a property in your ViewModel and simply get the value for that property using the projects localization resources.

I create a sample project of the described approaches, hope this is helpful. You can find the sample project attached to my response.

Regards,
Vladi
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Docking
Asked by
Pierre
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or