Esempio n. 1
0
        public void EnsureAndOpenChat(AngebotViewModel angebotVM)
        {
            foreach (var chat in Chats)
            {
                if (chat.AngebotViewModel.Angebot.Id == angebotVM.Angebot.Id)
                {
                    Open(chat);
                    return;
                }
            }

            var chatInfo = new ChatInfo();

            chatInfo.AngebotID            = angebotVM.Angebot.Id;
            chatInfo.NachrichtenAccess    = angebotVM.Angebot.NachrichtenAccess;
            chatInfo.GegenseiteAnbieterID = angebotVM.Angebot.AnbieterId;

            var chatVM = new ChatViewModel(chatInfo, Factory.GetChatPollingService(), Factory.GetChatService(), Factory.GetLoginService(), Factory.GetChatBufferService(), Factory.GetProfilService(), angebotVM.Angebot);

            Chats.Add(chatVM);
            Open(chatVM);
        }
Esempio n. 2
0
 public void SelectedChatChanged(ChatViewModel selectedChat)
 {
     SelectedChat = selectedChat;
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedChat)));
     SelectedChat?.RefreshBindings();
 }
Esempio n. 3
0
 private void Open(ChatViewModel chatVM)
 {
     SelectedChat = chatVM;
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedChat)));
 }