24sharon
24sharon

Reputation: 1975

wpf add resources (resx file)

in my wpf project i try add resx file but getting error

i add to window this code: xmlns:Resources="clr-namespace:Swipper.Resources"

and on the content i add

Content="{x:Static MemberType= Resources:App, Member=Blue}"

this is work and the application complied, but on visual studio i getting this error. enter image description here

what can i do for removing this error or what is the way to use resx text.

thanks

Upvotes: 1

Views: 3637

Answers (1)

hbarck
hbarck

Reputation: 2944

In the resources designer in Visual Studio, set the access modifier to public. Also, use the XAML editor's intellisense feature to locate the correct type an members, your parameters seem to be faulty.

For other ways of accessing localized resources in WPF, you might want to read http://wpfglue.wordpress.com/category/localization/

Upvotes: 1

Related Questions