vb.net - VB .Net WPF Binding 2 controls to dictionary -
i have been trying head round binding in wpf forms , lost in this. i'm trying binding in vb .net code. have interface:
implements inotifypropertychanged
and if have dictionary:
public property mydict new dictionary(of string, string)
which fill key-value bunch of data, populate combobox on wpf window key. far using following:
mycombo.itemssource = mydict mycombo.displaymemberpath = "key"
then i'm trying link combobox textblock, combobox shows key , textblock shows value. there lots of these combobox-textbox combinations, can't hard code or have in xaml. last thing tried following:
dim abinding new binding("value") abinding.source = mydict mytextblock.setbinding(textblock.textproperty, abinding)
this shows textblock have first value in dictionary, doesn't alter combobox. i've tried binding combobox in same manner , new binding variable, has effect of blanking combobox, cannot seem working.
apologies if really, simple problem, i'm new @ using binding in wpf, because i've avoided it.
you may create textblock binding this:
dim abinding new binding("selecteditem.value") abinding.source = mycombo mytextblock.setbinding(textblock.textproperty, abinding)
Comments
Post a Comment