动态资源使用格式
在xaml文件中:
"{DynamicResource YourPath}"
"{DynamicResource ResourceKey=YourPath}"
资源文件
假设有中英文两种语言切换,那么就需要有类似语言库的文件。
新建的language文件夹中包含:
Chinese.xaml
English.xaml
以中文为例:
在Chinese.xaml中:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib">
<sys:String x:Key="CtrlC_CtrlV.Resource.Search">查询:</sys:String>
<sys:String x:Key="CtrlC_CtrlV.Resource.Value">值</sys:String>
<sys:String x:Key="CtrlC_CtrlV.Resource.Name">名称</sys:String>
<sys:String x:Key="CtrlC_CtrlV.R