简体   繁体   English

WPF中发生XamlParseException错误

[英]XamlParseException Error Occured in WPF

I have created PRISM WPF Application. 我已经创建了PRISM WPF应用程序。 It has two Modules 它有两个模块

  1. Wpf application, BootStapper, Shell WPF应用程序,BootStapper,Shell

    1. Class Library, Contains *.resx files. 类库,包含* .resx文件。

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.

相关问题 新手错误:WPF应用程序中发生XamlParseException - Newbie error: XamlParseException occured in WPF application 带有 Observablecollection 的 Listview 上的动画,在 WPF 中对项目进行排序时发生 XamlParseException - Animation on Listview with Observablecollection, XamlParseException occured when sort items in WPF WPF XAML Parse异常发生错误? - WPF XAML Parse Exception occured Error? Xamarin.Forms.WPF XamlParseException - Xamarin.Forms.WPF XamlParseException 是什么在WPF应用程序中导致XamlParseException? - What is causing XamlParseException in WPF application? XamlParseException是未处理的错误 - XamlParseException was unhandled error XamlParseException错误模板 - XamlParseException error template WPF:安装在XP上的WPF应用程序中的XamlParseException - WPF : XamlParseException in WPF application when installed on XP WPF错误:“ System.Windows.Markup.XamlParseException:&#39;DataGridRow&#39;TargetType与元素&#39;GridRowContent&#39;的类型不匹配。” - WPF error: “System.Windows.Markup.XamlParseException: 'DataGridRow' TargetType does not match type of element 'GridRowContent'.” Binding.UpdateSourceTrigger在WPF中提供XamlParseException / TargetInvocationException - Binding.UpdateSourceTrigger giving XamlParseException/TargetInvocationException in WPF
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM