RadDocking.LoadLayout and localization

1 Answer 82 Views
Docking
Luigi
Top achievements
Rank 3
Bronze
Iron
Iron
Luigi asked on 12 Apr 2024, 10:03 AM
Hi
I'm using RadDocking.LoadLayout to save and restore the positions of docked panels.
My application is localized and every string in xaml is set in this form (for instance...):

Header="{DynamicResource ResourceKey={x:Static r:ResourcesKeys.key}}"
Where r:ResourcesKey.key is an index in the language dictionary selected in the application.

When I change the localization with  an existing xml for layout, the headers of panels are read from the xml and are in the previous language.
Ho can I force to rewrite the strings in the right language (without delete the layout xml file)?

Thank you
Luigi

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 16 Apr 2024, 02:19 PM

Hello Luigi,

You should be able to achieve your requirement with the ElementLoading event of RadDocking. This will allow you to manually set the Header to the proper localization value in code-behind.

private void RadDocking_ElementLoading(object sender, Telerik.Windows.Controls.LayoutSerializationLoadingEventArgs e) 
{ 
    var pane = e.AffectedElement as RadPane;  
    if (pane != null) 
    { 
		pane.Header = /* get the localized header */
    } 
} 

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Luigi
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 17 Apr 2024, 02:06 PM

Hi Martin, thank you

I implemented your proposal: it works using ElementLoaded instead of ElementLoading

Luigi

Tags
Docking
Asked by
Luigi
Top achievements
Rank 3
Bronze
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or