[英]XamlParseException Error Occured in WPF
I have created PRISM WPF Application. 我已经创建了PRISM WPF应用程序。 It has two Modules
它有两个模块
Wpf application, BootStapper, Shell WPF应用程序,BootStapper,Shell
Here, i have created UserControl.xaml in WPF application and loaded *.resx file like below, 在这里,我在WPF应用程序中创建了UserControl.xaml并加载了* .resx文件,如下所示,
xmlns:ResxFile="clr-namespace:Books.Resources.English;assembly=Books.Resources"
<cb:BaseView.Resources>
<ResxFile:ScreenFieldNames x:Key="ScreenFieldNames"/>
</cb:BaseView.Resources>
<TextBlock Text="{Binding AddField, Source={StaticResource ScreenFieldNames}, FallbackValue='Add Field'}" Grid.Row="1" Grid.Column="2"/>
But i am getting following error 但我得到以下错误
An exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll but was not handled in user code
PresentationFramework.dll中发生类型为'System.Windows.Markup.XamlParseException'的异常,但未在用户代码中处理
Additional information: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.'
附加信息:“在“ System.Windows.StaticResourceExtension”上提供值引发了异常。 Line number '62' and line position '20'.
行号“ 62”和行位置“ 20”。
Please help me on this 请帮我
No need to add it as a Resource
. 无需将其添加为
Resource
。 You can access it directly since you have defined the namespace. 由于已经定义了名称空间,因此可以直接访问它。
xmlns:ResxFile="clr-namespace:Books.Resources.English;assembly=Books.Resources"
<TextBlock Text="{x:Static ResxFile:ScreenFieldNames.AddField}"/>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.