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 = ? } 
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
Post a Comment