开发者

Problem retrieving dictionary from Isolated Storage

During the first run, I am storing a dictionary<string,dictionary<string,string>> (lets call it CategoryDictionary). When I re-run the code (without closing the emulator), the count in the categorydictionary becomes null.

Whatever I am getting from the categorydictionary are suppose to be displayed on the UI, so because of th开发者_Go百科is problem am getting data on the UI only in the first run but 2nd run results in blank screen

while (enum1.MoveNext())
{
    KeyValuePair<string, string> keyvalue = (KeyValuePair<string, string>)enum1.Current;
    string key = keyvalue.Key;
    WidgetBean bean = null;
    dict.TryGetValue(key, out bean);
    ret.Add(key, bean);
}

So basically in the 2nd run bean has null values for all entries.


   using System.Runtime.Serialization;
    [DataContact]
    public class classname()
    {
     [datamember]
     public int propertyname;
     }

i did this and the code is working fine now..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜