1

I have created PRISM WPF Application. It has two Modules

  1. Wpf application, BootStapper, Shell

    1. Class Library, Contains *.resx files.

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

1 Answer 1

2

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}"/>
Sign up to request clarification or add additional context in comments.

2 Comments

I tried this as well.. Same error is popping out. Is there any other problem?
make sure the AccessModifier of the resx is set to Public

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.