First of all you can’t bind to variable
. You can bind only to properties
from XAML.
For binding to static property you can do in this way (say you want to bind Text
property of TextBlock
) –
<TextBlock Text="{Binding Source={x:Static local:YourClassName.PropertyName}}"/>
where local
is namespace where your class resides which you need to declare above in xaml file like this –
xmlns:local="clr-namespace:YourNameSpace"