private void RemoveInvite(InviteViewModel invite) { for (int i = 0; i < Invites.Count; i++) { if (Invites[i] == invite) { Invites.RemoveAt(i); } } }
private void OnNewInvite(AndersonInvite invite) { var inVM = new InviteViewModel(invite); inVM.InviteProcessed += ProcessInvite; if (App.Current?.Dispatcher == null || App.Current.Dispatcher.CheckAccess()) { Invites.Add(inVM); } else { App.Current.Dispatcher.Invoke(() => Invites.Add(inVM)); } }
private void ProcessInvite(InviteViewModel invite, bool accept) { if (LogoutStatus != "Logout") { return; } RemoveInvite(invite); if (accept) { _roomBack.JoinRoomAsync(invite.Invite.Room); } else { _roomBack.RejectInviteAsync(invite.Invite.Room); } }