예제 #1
0
        /// <summary> Получить чат из текушего списка чатов </summary>
        public ModelChat GetChatFromList(ModelContact modelContact)
        {
            var result = new ModelChat();

            var modelChat = DataSourceChat.GetModelChatByModelContact(modelContact);

            var modelChatFromList = CurrentListModelChat.FirstOrDefault(obj => obj.Id == modelChat.Id);

            if (modelChatFromList != null)
            {
                result = modelChatFromList;
            }
            else
            {
                CurrentListModelChat.Add(modelChat);

                result = modelChat;
            }

            return(result);
        }
예제 #2
0
        /// <summary> Конструктор </summary>
        public ViewModelChatDetail(ModelContact modelContact)
        {
            var modelChat = DataSourceChat.GetModelChatByModelContact(modelContact);

            InitializatiOnoverallConstructors(modelChat);
        }