c# - Get the Key and Value from Dictionary in Silverlight Application -


i need value dictionary(which returned webservice) in silverlight application.

i dictionary value in variable val .

 serviceclient.getmappingcompleted += (obj, val) => {               //here need key , value result             int key = ?            string value = ?  } 

enter image description here

you may access dictionary using val.result. here code:

foreach (keyvaluepair<int, string> item in val.result) {     int key = item.key;     string value = item.value; } 

if looking first keyvaluepair in dictionary may try (don't forget add using system.linq; first method available) :

 var key = val.result.first().key;  var value = val.result.first().value; 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -