Just wondering if it is possible to dynamically create a list of strings in XAML based on language/culture? Say if user logs in as an English user it shows Client Name, Order Number… and if user logs in as a Polish user it shows Nazwa klienta, Numer zamówienia instead?
I only know the hardcoded one like below:
<System_Collections_Generic:List`1 x:Key="columnNameList">
<System:String>Client Name</System:String>
<System:String>Order Number</System:String>
<System:String>Date</System:String>
</System_Collections_Generic:List`1>
I would suggest using a resource file and a markup extension. In the resource file, you create string ressources, and you make localized resource files for each language. In the markup extension, you just return the value of the string from the resources (it will automatically pick up the appropriate language from the satellite resource assembly for the current culture).
Markup extension
XAML
By the way, you can’t use generics in XAML (well, you can in XAML 2009, but it’s not supported in VS yet). So you need to create a non generic class that represents a list of strings :