Monday, 15 June 2015

.net - How to bind one texblock value to other textblock one way and get value in MVVM -



.net - How to bind one texblock value to other textblock one way and get value in MVVM -

let me explain question image

i have mvvm construction in project. have 2 textblocks, textblock 1 , textblock 2. want textblock2's text same textblock1's text, whenever textblock1's text changed. should able set textblock2's text different textblock1's. setting oneway binding of textblock1's text property.

how can text property of textblock2's in mvvm. if create property textblock2's text property, wont able bind textblock1's text textblock2.

let me know if want clear question further.

thanks in anticipation.

use 2 properties in vm, , implement equal/override logic there. that's kind of stuff vms in.

vm prop1 <-- binding- textblock1 prop2 <-- binding- textblock2

the prop1 setter implemented such updates prop2 (don't forget inotifypropertychanged), if set prop2 create switch , maintain different value.

.net wpf xaml mvvm xaml-binding

No comments:

Post a Comment