wpf - Why does binding expression detach in OneWay mode? -


could explain me why first binding expression detached after click checkbox3 object...

<stackpanel>     <checkbox x:name="chackbox1" content="checkbox1"         ischecked="{binding elementname=chackbox2, path=ischecked, mode=oneway}" />     <checkbox x:name="chackbox2" content="checkbox2" ischecked="false" />     <checkbox x:name="chackbox3" content="checkbox3"         ischecked="{binding elementname=chackbox1, path=ischecked, mode=twoway}" /> </stackpanel> 

...and not happen in following scenario...

<stackpanel>     <checkbox x:name="chackbox1" content="checkbox1"         ischecked="{binding elementname=chackbox2, path=ischecked, mode=twoway}" />     <checkbox x:name="chackbox2" content="checkbox2" ischecked="false" />     <checkbox x:name="chackbox3" content="checkbox3"         ischecked="{binding elementname=chackbox1, path=ischecked, mode=twoway}" /> </stackpanel> 

...where mode changed twoway in first binding expression?

i'm asking explanation. know how omit tricky situation , know how debug binding expressions. found similar post here there no clear answer general problem.

in first scenario, checkbox1 has oneway binding, cannot accept changes value except via checkbox2. if checkbox3 tries set checkbox1 invalidate binding, , set raw value.

if want checkbox3 set checkbox1 (which updates checkbox2) rather oneway binding need onewaytosource


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -