Exemplo n.º 1
0
        /// <summary>
        /// 将SDK的topic类型转换为界面ChatList中的项类型
        /// </summary>
        public static ChatListChatItemVM TopicToChatListItem(Topic topic)
        {
            if (topic == null)
            {
                return(null);
            }

            var contact = CommunicationCore.GetContactByTopicName(topic.Name);

            var chatListItem = new ChatListChatItemVM()
            {
                TopicName      = topic.Name,
                Contact        = contact,
                LastActiveTime = GlobalFunctions.TimestampToDateTime(topic.LastUsed),
                RawTopic       = topic,
                MaxMsgSeq      = topic.MaxLocalSeqId
            };

            return(chatListItem);
        }
 public MessageViewer(ChatListChatItemVM chatItem)
 {
     this.InitializeComponent();
     this.MessageViewerList.DataContext = this;
     VM = new MessageViewerViewModel(chatItem);
 }