/// <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); }
/// <summary> Конструктор </summary> public ViewModelChatDetail(ModelContact modelContact) { var modelChat = DataSourceChat.GetModelChatByModelContact(modelContact); InitializatiOnoverallConstructors(modelChat); }