wpftoolkit - how to bind an autocompletebox with a model in mvvm? -



wpftoolkit - how to bind an autocompletebox with a model in mvvm? -

i exposed collection , binded itemsource of autocompletebox works selecting or changing text on autocompletebox doesn't update model textbox or label!

viewmodel:

public observablecollection<string> symptomsdb { get; private set; } private string symptom; public string symptom { { homecoming symptom; } set { symptom = value; raisepropertychanged(() => this.symptom); } } public analysisviewmodel() { list<string> s = new list<string>(); s.add("test"); symptomsdb = new observablecollection<string>(s); }

view:

<controls:autocompletebox itemssource="{binding symptomsdb}" selecteditem="{binding symptom}" text="{binding symptom}" istextcompletionenabled="true" filtermode="contains"/>

to alter user interface viewmodel, need bind property twoway (except properties textbox.textproperty twoway default):

<controls:autocompletebox itemssource="{binding symptomsdb}" selecteditem="{binding symptom, mode=twoway}" text="{binding symptom}" istextcompletionenabled="true" filtermode="contains"/>

mvvm wpftoolkit

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -