I have a situation where some application wide values are stored as constants - this is a requirement as they are needed in attribute definitions (attributes must resolve at compile time, so even static members don't work).
I wish to also be able to also reuse these values in XAML files. So if I have my constants like this:
public class MyConstants
{
public const string Constant1 = "Hello World";
}
I want to one way bind them to controls defined in XAML something like this:
<TextBlock Text="{Binding MyConstants.Constant1}" />
Is this possible in a straight forward manner? I've looked over binding examples but can't seem to find this sort of scenario.
Would there maybe be some kind of work around I could do (maybe bindings translated into parameters for a method that dynamically pulls the constant field via reflection)