0

-je faire une application dans le chat dans le téléphone windows, j'ai un nom de classe GetFriendResponse commeComment lier friendlist comme longlistselector dans windows phone 8

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; } 
    } 

et _utilisateur de classe comme

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; } 

    } 
} 



    } 

maintenant je veux faire frendslist comme longlistelector quand sever réponse 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; 

mais cela ne fonctionne pas, n'importe qui h J'ai une idée pour le réparer, merci beaucoup!

Répondre

0

Il peut s'agir de la liaison de votre page XAML car vous n'avez pas partagé les blocs de code de conception. Mieux, vous référez this page MSDN pour la liaison longelectorélecteur.