c# - How do I bind to one data source but update trigger from another? -
i have textbox oneway binding string property, , i'd update when other property on datacontext changes. datacontext observablecollection , textbox displays statistics collection. want statistics updated whenever collection changes, don't want have raise dummy "statistics changed" event.
in other words, xaml (or databinding generally) allow me specify 1 binding data of control , update event?
if understand correctly, there easier way achieve want:
<listbox itemssource={binding items} /> <textbox text="{binding items/propertyname}" />
assuming observablecollection
has bindable property named propertyname
in , view model (or datacontext
) has property called items
of type of observablecollection
, textbox
control display propertyname
value of selected item in collection.
you can find out more '/' path syntax propertypath xaml syntax page on msdn.
Comments
Post a Comment