in my MVVM application (in wpf)
i have two view and I want to bind the context of my label on my textbox value (in the other view)
SelectorView.xaml contain this control:
<TextBox x:Name="tbArt" value="XX"/>
DescriptionView.xaml contain this control:
<label context="{binding on the tbArt value????}">
Is that possible directly without going in code behing and viewmodels ?
Will the label be refresh automatically ?
Thanks !
If both of the controls databinds to the same property the label will refresh when the value is changed.Make sure that the property triggers property changed when it gets changed.
ex:
in XAML.
in the textbox make sure you use:
. otherwise the property won’t be changed until focus is shifted from the textbox.