Frank Monroe
Frank Monroe

Reputation: 1611

C# resource file - how to access internal resources from XAML?

This is my simple (newbie) understanding:
We have a choice for the Ressource Code Generator: internal or public. The default appears to be internal. I understand the resources are created with an internal or public accessor depending on that choice. Therefore, if the accessor is public I can use something like: Text="{x:Static resx:Resources.SomeLabelID}" ... in my XAML.
My question is either/both:

-OR-

Thank you

Upvotes: 2

Views: 1083

Answers (1)

Karolis Kajenas
Karolis Kajenas

Reputation: 1543

Everything defined in XAML is using internal access modifier. That is by design of WPF framework, simply so you will not be able to access locally defined controls in different assembly.

Generally if you are going to use strings for "static" controls (i.e. Label) then you can simply go a head with changing access modifier.

Upvotes: 2

Related Questions