3
我試圖本地化我的WinRT應用程序。我不需要任何太花哨的東西,所以我一直在使用XAML元素上的x:Uid和具有諸如「PageTitleTextBox.Text」屬性的資源文件。這種方法工作得很好,直到遇到附加屬性的問題。本地化XAML/WinRT中的附加屬性
我定義使用類似的標記幾個應用程序欄按鈕,我已經看到了其他的例子:
<Button x:Name="AddFolderButton" Click="AddFolderButton_Tapped" x:Uid="FoldersPageAppBarAddFolderButton" AutomationProperties.Name="Test" Style="{StaticResource AppBarButtonStyle}">
<Button.Content></Button.Content>
</Button >
在這種情況下,我想本地化AddFolderButton的標籤,目前AutomationProperties.Name
定義。我嘗試在我的資源文件中將密鑰設置爲FoldersPageAppBarAddFolderButton.AutomationProperties.Name
,但在運行時會失敗。
是否可以使用XAML本地化此標籤,還是需要在代碼隱藏文件中以編程方式執行此操作?