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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -