private void lstRoom_MouseDoubleClick(object sender, MouseButtonEventArgs e) { if (lstRoom.SelectedItem != null) { mSelectedRoom = (ViewModel.Room)lstRoom.SelectedItem; Protocol.SelectRoom select = new Protocol.SelectRoom(); select.Room = mSelectedRoom.ID; mClient.Send(select); } }
private void ListRoomResponse(Protocol.ListRoomResponse e) { foreach (Protocol.RoomInfo item in e.Items) { ViewModel.Room room = mRooms.FirstOrDefault(d => d.ID == item.ID); if (room == null) { room = new ViewModel.Room(); mRooms.Add(room); } room.ID = item.ID; room.Name = item.Name; room.Count = item.Count; } }