Reputation: 5794
I'm attempting to localize my WinRT app. I don't need anything too fancy, so I've been using x:Uid on XAML elements in conjunction with resource files that have properties such as "PageTitleTextBox.Text" set. This method was working great until I ran into an issue with attached properties.
I've defined a few app bar buttons using similar markup to what I've seen in other examples:
<Button x:Name="AddFolderButton" Click="AddFolderButton_Tapped" x:Uid="FoldersPageAppBarAddFolderButton" AutomationProperties.Name="Test" Style="{StaticResource AppBarButtonStyle}">
<Button.Content></Button.Content>
</Button >
In this case, I'd like to localize AddFolderButton's label, currently defined by AutomationProperties.Name
. I tried setting a key in my resource file to FoldersPageAppBarAddFolderButton.AutomationProperties.Name
, but this fails on runtime.
Is it possible to localize this label using XAML, or do I need to do this programatically in the code-behind file?
Upvotes: 4
Views: 1062