I have a situation where some application values ββare widely used as constants - this is a requirement, since they are necessary in attribute definitions (attributes must be resolved at compile time, so even static members do not work).
I also want to be able to reuse these values ββin XAML files. Therefore, if I have such constants:
public class MyConstants
{
public const string Constant1 = "Hello World";
}
I want one way to associate them with controls defined in XAML as follows:
<TextBlock Text="{Binding MyConstants.Constant1}" />
Is it possible straightforward? I looked at the binding examples, but cannot find such a scenario.
Maybe there will be some work that I could do (maybe the bindings were translated into parameters for a method that dynamically pulls a constant field through reflection)