var context =
new
ResourceContext();
context.Languages =
string
[] { Windows.System.UserProfile.GlobalizationPreferences.Languages[0].ToString() };
ResourceMap resourceMap = ResourceManager.Current.MainResourceMap.GetSubtree(
"Resources"
);
GenerateToast(resourceMap.Uri.AbsoluteUri.ToString());
String str = resourceMap.GetValue(
"MyTitle"
, context).ValueAsString;
public
static
Get(
key)
{
var getterString = Windows.ApplicationModel.Resources.ResourceLoader.GetForCurrentView().GetString(key);
return
getterString;
}
class
LocalizedStrings : IValueConverter
private
readonly
Windows.ApplicationModel.Resources.ResourceLoader LocalizedResourceLoader =
Windows.ApplicationModel.Resources.ResourceLoader();
LocalizedResourceLoader.GetString(key);
object
Convert(
value, Type targetType,
parameter,
language)
if
(parameter ==
null
)
.Empty;
(parameter
is
LocalizedResourceLoader.GetString((
)parameter);
else
ConvertBack(
parameter, System.String language)
throw
NotImplementedException();
<
TextBlock
Text
=
"{Binding Converter={StaticResource LangConverter}, ConverterParameter=HeaderText}"
/>