I am migrating an app from Windows 8 to UWP. The app uses string resources for localization. In Windows 8 I used to do this to localize AppBar buttons:
<Style x:Key="SkipAheadAppBarButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource AppBarButtonStyle}">
<Setter Property="AutomationProperties.AutomationId" Value="SkipAheadAppBarButton"/>
<Setter x:Uid="Step" Property="AutomationProperties.Name" Value=".skip"/>
<Setter Property="Content" Value=""/>
</Style>
And then I would have a string for "Step.Value". For some reason that does not work in UWP project in Visual Studio 2017. The button shows ".skip" instead of the actual value of Step.Value in Resources.resw.
Simpler <Run x:Uid="App" Text=".Rob"/> works without any problems.
We can not use the
x:Uidin theSetter.For more info, please refer Remarks of x:Uid directive.
You should be able to add
x:Uidin theButton.For example:
You should be able to set
MyButton.AutomationProperties.Nameto theNameandYourValueto theValueof the Resources.resw.I have also test the
<Run x:Uid="App" Text=".Rob"/>, it will throw exception. If you can use it in UWP, could you please give us a sample?