Mar 14 at 12:12 PM
Edited Mar 14 at 12:26 PM
|
I have a main window that is based on a control template. Which means that I dont have xaml for the window itself (just the control template). So my options to change parameters of the window are either in the code or in the style.
As presented here: http://wpflocalizeextension.codeplex.com/discussions/434583 style does not work for some reason, so following code will fail (after changing the language):
<Style TargetType="{x:Type Windows:MainWindow}" BasedOn="{x:Null}">
<Setter Property="Template" Value="{DynamicResource MainWindowControlTemplate}" />
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Title" Value="{lex:Loc Assembly:Dict:WindowTitle}"/>
</Style>
So I would like to try code... In the window constructor I do something like that:
Title = ResourcesHelper.GetLocalisationString(Consts.MainWindowTitleResourceKey);
The method uses locExtension.ResolveLocalizedValue to get the value which works... However, when I change the language the title is not updated.
Do I have any other options?
|