Question: Is it possible to access a static variable from code behind to be used in XAML?
Reason: I want a single string variable to keep a menu name which will be used in different places (in code behind and also in XAML).
Example (code behind):
public partial class MainWindow : Window
{
public static readonly string menuName = "MyMenu";
... other code ...
}
Example (XAML):
<MenuItem Header="... here I want my menuName to appear ..." />