【发布时间】:2013-07-01 06:50:42
【问题描述】:
在我的wpf项目中,我添加了两个资源文件:
Resources\English.resx and Resources\German.resx
在 MainWindow.xml 中,我尝试从资源文件中查找值:
<Window x:Uid="Window_1" x:Class="LocalizationInvestigate.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Resources="clr-namespace:LocalizationInvestigate.Resources"
Title="MainWindow" Height="350" Width="525">
<Grid x:Uid="Grid_1">
<Label x:Uid="Label_1" Content="{x:Static Resources:English.LabelHello}"></Label>
</Grid>
</Window>
对于英语,这种方式可以完美运行。但是,根据本地语言,如何使用:Resource:German.LabelHello 使其自动切换到德语?
【问题讨论】:
标签: wpf localization