binding - WPF Bind to ViewModel of another element -
just example. customcontrol has viewmodel property called "test"
how bind textbox specific property? can access siblings viewmodel?
<textbox text="{binding elementname=mycontrol, path=viewmodel.test}"></textbox> <controls:customcontrol x:name="mycontrol" />
siblings viewmodel in datacontext try
<textbox text="{binding elementname=mycontrol, path=datacontext.test}"></textbox> <controls:customcontrol x:name="mycontrol" />
Comments
Post a Comment