wpf - How to bind only to the base of a Path? -


let's assume have binding:

 <textblock text="{binding mybaseproperty.mysubproperty}" /> 

is possible tell wpf listen changes mybaseproperty? , whenever mybaseproperty changes (re-)query mysubproperty of mybaseproperty?

the background behind question is: have view model contains property (mybaseproperty) pointing instance of class not implement inotifypropertychanged interface. datacontext textblock implement inotifypropertychanged interface , can therefore inform view changes mybaseproperty.

if great if found accomplish kind of base-with-path-binding way can around valueconverters , extending viewmodel inotifypropertychanged-backed property wrappers mysubproperty.

this fix you,

you can listen mybaseproperty changed event , when happens ..

you can force binding updates --

bindingoperations.getbindingexpressionbase(_mytextbox, textbox.textproperty).updatetarget(); 

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -