Kalanamith
Kalanamith

Reputation: 20648

WPF C# how to bind values defined in AppStrings.resx to XAML Content

Um trying to access a value defined in the AppStrings.resx As follows but it is not working , how may I access a value defined directly ?

             xmlns:Resources="clr-namespace:VApp.Wpf.Properties"
             Content="{Binding Resources.AppStrings.Delete_Button_Content}"

Upvotes: 0

Views: 382

Answers (1)

Nikhil Vartak
Nikhil Vartak

Reputation: 5117

If you check the generated code for resource (.resx) file you will see that the class in there is static. So you should be binding those resources using x:Static.

<TextBlock Text="{x:Static Resources:AppStrings.Delete_Button_Content}" />

Upvotes: 2

Related Questions