Ejemplo n.º 1
0
        private void AddCappuChatViewModel(SimpleConversation conversation, bool setAsCurrentChatViewModel = false, params SimpleMessage[] messages)
        {
            var chatViewModel = new CappuChatViewModel(_signalHelperFacade, conversation, _viewProvider);

            chatViewModel.ConversationHelper.AddNewMessage      += ChatViewModelOnAddNewMessage;
            chatViewModel.ConversationHelper.NewMessagesChanged += ChatViewModelOnNewMessagesChanged;

            Conversations.Add(chatViewModel);

            chatViewModel.Load(messages);

            if (setAsCurrentChatViewModel)
            {
                CurrentChatViewModel = chatViewModel;
            }
        }
Ejemplo n.º 2
0
 private bool CheckForExistingConversation(string targetUsername, out CappuChatViewModel chatViewModel)
 {
     chatViewModel = Conversations.FirstOrDefault(con => con.Conversation.TargetUsername.Equals(targetUsername, StringComparison.CurrentCultureIgnoreCase));
     return(chatViewModel != null);
 }