Reputation: 159
I have created PRISM WPF Application. It has two Modules
Wpf application, BootStapper, Shell
Here, i have created UserControl.xaml in WPF application and loaded *.resx file like below,
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
Additional information: 'Provide value on 'System.Windows.StaticResourceExtension' threw an exception.' Line number '62' and line position '20'.
Please help me on this
Upvotes: 1
Views: 1448
Reputation: 17392
No need to add it as a 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}"/>
Upvotes: 2