Esempio n. 1
0
 public void SearchUser(string searchBy)
 {
     if (searchBy != "")
     {
         List <UserDTO> userList = new List <UserDTO>();
         foreach (var item in client.GetAllUsers())
         {
             if (item.Name.Contains(searchBy))
             {
                 userList.Add(item);
             }
         }
         AllUsers = userList;
     }
     else
     {
         AllUsers = client.GetAllUsers();
     }
 }
Esempio n. 2
0
 public MainMenuViewModel(UserDTO current)
 {
     CurrentUser = current;
     client      = new ZaolisServiceClient.ZaolisServiceClient(new System.ServiceModel.InstanceContext(handler));
     AllUsers    = client.GetAllUsers();
     FriendUsers = client.GetContacts(CurrentUser);
     ChatInfos   = new ObservableCollection <ChatInfoModel>();
     if (client.GetUserChats(CurrentUser) != null)
     {
         Chats = new ObservableCollection <ChatDTO>(client.GetUserChats(CurrentUser));
         foreach (var chat in Chats)
         {
             ChatInfos.Add(new ChatInfoModel(client, CurrentUser, chat));
         }
     }
     //CurrentAvatar = client.GetAvatar(CurrentUser);
 }