Ejemplo n.º 1
0
        public void UpdateMessage(CompletePacket packet)
        {
            viewModel.RoomModel.Clear();

            ROOM_LIST_RES res = new ROOM_LIST_RES();

            res = ROOM_LIST_RES.Parser.ParseFrom(packet.Data);

            foreach (var room in res.VarRoomList)
            {
                CommunityRoomInfoModel croom = new CommunityRoomInfoModel();
                croom.Id           = room.VarId;
                croom.Name         = Helper.ToStr(room.VarName.ToByteArray());
                croom.CurrentCount = room.VarCurrentCount;

                viewModel.RoomModel.Add(croom);
            }

            listView.ItemsSource = viewModel.RoomModel;

            if (User.myInfo.PhotoPath != null && mypicture.Source == null)
            {
                mypicture.Source = ImageSource.FromUri(new Uri(User.myInfo.PhotoPath));
            }
        }
Ejemplo n.º 2
0
        public void UpdateMessage(CompletePacket packet)
        {
            viewModel.RoomModel.Clear();

            ROOM_LIST_RES res = new ROOM_LIST_RES();

            res = ROOM_LIST_RES.Parser.ParseFrom(packet.Data);

            foreach (var room in res.VarRoomList)
            {
                CommunityRoomInfoModel croom = new CommunityRoomInfoModel();
                croom.Id           = room.VarId;
                croom.Name         = Helper.ToStr(room.VarName.ToByteArray());
                croom.CurrentCount = room.VarCurrentCount;

                viewModel.RoomModel.Add(croom);
            }

            listView.ItemsSource = viewModel.RoomModel;
        }