Designer displaying @myLocalizedText rather than actual values

Feb 26, 2013 at 10:19 AM
Edited Feb 26, 2013 at 10:19 AM
Hi, firstly- sorry if this has been answered, I can't find it.

In my designer I'm getting the @ prefixed key name rather than the actual localized resource string. I'm using VS2012 with update 1, and our resources are in an external assembly.

I have the following XAML:
   <Window x:Class="Company.Product.Shell"
    ...
            xmlns:lex="http://wpflocalizeextension.codeplex.com"
            lex:LocalizeDictionary.DesignCulture="en"
            lex:ResxLocalizationProvider.DefaultAssembly="Company.Product.Resources"
            lex:ResxLocalizationProvider.DefaultDictionary="Strings"
            Title="{lex:Loc windowTitle}">
    ...
    </Window>
This seems to access the Strings.resx file and show its value: @windowTitle, what do I need to do to get it showing the value from the Strings.en-GB.resx?
Coordinator
Feb 28, 2013 at 6:33 PM
Hi,

this may be related to the other issue in the discussion that is on top right now ("dot in assembly issue").
Mar 1, 2013 at 10:10 AM
Yes, that's why I posted there too :)

However, my issue is distinctly only in the designer and also as mentioned I'm running VS2012 update 1. I think update 2 is due very soon so I will see if that makes a difference.

As a side note, I'm not worried about designer support right now as I've just had to make a custom Label control that needs the key string for the localized resource as an identifier to save a customized, overriding caption (edited at runtime via my new control).

I achieved this by changing my XAML to pass the key string rather than the markup extension resource binding, so:
Content="{lex:Loc titleText_monitor}" 
becomes
Content="titleText_monitor"
I spent quite a lot of time trying to work with the binding to access the key value but failed to find a way. Instead, I handle the Initialized event of the label and store the key, then update the label Content with a binding created in code.

I am then free to use the key that relates to a specific resource to save a custom user entered caption and reload it onto any label that has the same key. It would be far cooler if the override could keep the binding, thus designer support (when its working) and also if there was a simple way to edit the content of the resource dictionary at runtime so the override value could also be culture specific and not require a separate config. I'm sure that will go over most peoples heads, but I thought I'd share it anyway. I'm happy to elaborate but can't include direct code examples :)