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); }
public void SelectedChatChanged(ChatViewModel selectedChat) { SelectedChat = selectedChat; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedChat))); SelectedChat?.RefreshBindings(); }
private void Open(ChatViewModel chatVM) { SelectedChat = chatVM; PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedChat))); }