【发布时间】:2010-10-22 15:42:24
【问题描述】:
我有一个 XAML 字符串表,当我需要从 XAML 中的控件中引用它时,它正在发挥作用。
但是,我也可以访问它以在其他代码部分中使用它——例如我的模型中的验证消息。由于您无法将资源文件添加到 silverlight,因此我需要使用它。
必须有人知道我需要调用什么来获取资源文件,最好是强类型的,以便智能感知可以避免我的健忘。
资源文件定义
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<system:String x:Key="test">test</system:String>
</ResourceDictionary>
【问题讨论】:
标签: silverlight silverlight-4.0 resourcedictionary