I'm in a different part of the coding now. I'm looking of best practices in
localise  a WPF application. There are lots of articles around that discuss
using locbaml or resx files and binding. The locbaml approach looks tedious
and I won't consider it unless someone has something nice to say on its
behalf.

 

Using resources generated from resx files is more familiar to me. I wrote a
little test IValueConverter that acted as both source and converter, it
works, but the XAML to call it is ridiculous and would bloat the XAML
terribly.

 

<app:AppResourceConverter x:Key="rescon"/>

...

Content="{Binding Path=Lookup,Source={StaticResource rescon}, Mode=OneWay,
Converter={StaticResource rescon}, ConverterParameter='FooKey'}"

 

So I set the resx generated class to be public and use XAML like this:

 

xmlns:app="clr-namespace:MyCompany.MyApp"
...
Content="{x:Static app:AppResources.StringFooKey}"

 

Now this looks much crisper and readable, but I have to set the resx tool
generated class to public and the class will grow to have huge numbers of
public properties as the number of strings .

 

Has anyone else had to localise a significant WPF application in anger? Are
there other tricks I haven't thought of that make the process easier?

 

I see Rick Strahl has written a markup extension
(wpflocalization.codeplex.com) which looks hopeful and I'm reading about
now.

 

Greg

 

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to