首页 > 代码库 > WPF Uri

WPF Uri

场景:自定义控件Generic.xaml样式引用资源字典Dictionary1.xaml.

方式:绝对路径.

方式1:

1 <ResourceDictionary>
2     <ResourceDictionary.MergedDictionaries>
3         <ResourceDictionary Source="pack://application:,,,/DLL名称;component/Themes/Dictionary1.xaml" />
4     </ResourceDictionary.MergedDictionaries>
5 </ResourceDictionary>

 方式2:

1 <ResourceDictionary>
2     <ResourceDictionary.MergedDictionaries>
3         <ResourceDictionary Source="/DLL名称;component/Themes/Dictionary1.xaml" />
4     </ResourceDictionary.MergedDictionaries>
5 </ResourceDictionary>

 

WPF Uri