Is there a way to bind a Dictionary in mvvmcross -



Is there a way to bind a Dictionary in mvvmcross -

i started using observable concurrentdictionary because it's threadsafe. face problem how bind list.

local:mvxbind="itemssource sourcedictionary"

obviously cannot work because item consists of keyvaluepair , not object itself.

local:mvxbind="itemssource sourcedictionary.values"

does not work. which, must admit, puzzles me. tried long shot , did converter :

public class sourcedictionaryvalueconverter : mvxvalueconverter<keyvaluepair<string, sourceclass >, sourceclass > { protected override sourceclass convert(keyvaluepair<string, sourceclass> value, type targettype, object parameter, cultureinfo culture) { homecoming value.value; } }

and bind

local:mvxbind="itemssource sourcedictionary, converter=sourcedictionary"

but didn't work. suppose asks ilist. there way bind listview dictionary?

you should able bind dictionary - or indeed ienumerable.

if binding dictionary (rather values) need write item bindings know keyvaluepair - e.g. might need bind key.name rather name.

however, dictionary's not notify listeners of changes - using dictionary using list - not using observablecollection. if want type of behaviour need write or find dictionary class implements inotifycollectionchanged.

mvvmcross

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -