I am converting a silverlight XAML/C# app to Metro. For C# code there is no problem. For XAML, from what I read there is new support for XAML to simplify the process. However, I hope to reuse the same resx files so I prefer the old silverlight mechanism for XAML, i.e. Markup Extension or Binding. I just tried MarkupExtension but it doesn’t seem to support. How do I convert the resource binding. Note my goal is to reuse the name-value pairs in the resource files so I won’t be able to use the new Metro binding mechanism.
Any suggestion?
Something like this in silverlight:
XAML:
<sdk:TabItem Header="{Binding Path=Resource.charts, Source={StaticResource LocalizedStrings}}"/>
LocalizedStrings.cs
public partial class LocalizedStrings
{
private static Resources.Resource resource = new Resources.Resource();
public Resources.Resource Resource { get { return resource; } }
}
New Metro style localization that I won’t be able to use due to old code reuse:
<TextBlock x:Uid="HelloWorld" />
I end up writing a converter to change all my resource files. “somekey” from the Silverlight resource file is converted to “somekey.Content”. This will take care of some UI elements automatically with a Content property, such as Button.