private void loadContacts() { string _prefix = "NBS-"; GUIDHelper helper = GUIDHelper.getInstance(); ObservableCollection <ContactModel> initList = new ObservableCollection <ContactModel>(); for (int i = 0; i < 20; i = i + 1) { ContactModel m = new ContactModel(); //m.HashID = "00000" + i; m.HashID = helper.GetGUID().Substring(10); m.Message = _prefix + "" + i; m.AvatarHashID = "NBS-xxx-" + i; if (i % 2 == 0) { m.AvatarName = new BitmapImage(new Uri("pack://application:,,,/avatars/nbs100.png")); } else { m.AvatarName = new BitmapImage(new Uri("pack://application:,,,/avatars/fuchen200.png")); } initList.Add(m); } if (initList != null) { ResultList = initList; } }
private void loadMessage() { string _prefix = "NBS-"; GUIDHelper helper = GUIDHelper.getInstance(); ObservableCollection <MessageInfo> initList = new ObservableCollection <MessageInfo>(); for (int i = 0; i < 20; i = i + 1) { MessageInfo m = new MessageInfo(); //m.HashID = "00000" + i; m.HashID = helper.GetGUID().Substring(10); m.NickName = _prefix + "" + i; m.RealTime = DateTime.Now.AddHours((20 - 20 / (i + 1))).AddMinutes(-25 / (i + 1)); m.IsSelf = i % 3 == 0 ? false : true; if (i % 2 == 0) { m.AvatarImg = @"pack://*****:*****@"pack://application:,,,/avatars/fuchen200.png"; } int a = i > 5 ? i : 5; StringBuilder sb = new StringBuilder(); for (int j = 1; j < a; j++) { sb.Append(j + "kKsvK" + j); } m.MsgContent = sb.ToString(); initList.Add(m); } if (initList != null) { MsgRecordList = initList; } }