Is there a way to access My.Resources thru Xaml?
Like this
The problem is that by default, the tool that generates code for the Resources.resx file is VbMyResourcesResXFileCodeGenerator
("Custom tool" property of the project item). This tool generates a Module in which the resource properties are internal (Friend), so the StaticExtension can't access it. To solve that problem, you should change the custom tool for Resources.resx to PublicVbMyResourcesResXFileCodeGenerator
, which will generate public members.
Also, a VB module is roughly equivalent to a static (Shared) class, so there is no instance of Resources that could be used as the source of the binding, so you can't specify a Path for the binding. You should set the binding source directly to the property you want :
Note: there is another pair of tools available to generate the code for a resource file : ResXFileCodeGenerator
and PublicResXFileCodeGenerator
. These tools generate a class instead of a module.
EDIT: The namespace mapping to use is the following :
xmlns:myRes="clr-namespace:YourApplicationName.My.Resources"