I making an app chat in windows phone, I have a class name GetFriendResponse as
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RAMACHAT.Model
{
public class FriendInfo
{
public bool success { get; set; }
public int statusCode { get; set; }
public string message { get; set; }
public _user data { get; set; }
}
public class GetFriendResponse
{
public bool success { get; set; }
public int statusCode { get; set; }
public string message { get; set; }
public string _id { get; set; }
public List<_user> data { get; set; }
}
and class _user as
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RAMACHAT.Model
{
public class _user
{
public string _id { get; set; }
public string username { get; set; }
public string avatar { get; set; }
public bool isOnline { get; set; }
public bool isFollow { get; set; }
}
}
}
now I want make frendslist as longlistselector when sever response user frendslist
string result = await App.client.getAllFriends();
string resultHistory = await App.client.getChatHistory();
resultObject = JsonConvert.DeserializeObject<GetFriendResponse>(result);
var resultHistoryObject = JsonConvert.DeserializeObject<HistoryResponse>(resultHistory);
List<AlphaKeyGroup.AlphaKeyGroup1<_user>> DataSource = AlphaKeyGroup.AlphaKeyGroup1<_user>.CreateGroups(resultObject.data,
System.Threading.Thread.CurrentThread.CurrentUICulture,
(_user s) => { return s.username; }, true);
friendList.ItemsSource = DataSource;
but it not work , anyone have an idea to fix it,thanks so much !
It may be issue of your XAML page binding as you have not shared the design code blocks. Better you refer this MSDN page for longlistselector binding.