private void OnDeleteSenderCommandExecute(object p) { if (!(p is Sender sender)) { return; } Senders.Remove(sender); }
private async Task DeleteSender() { if (SelectedSender != null) { _senderService.Delete(SelectedSender); Messenger.Default.Send(SelectedSender); Senders.Remove(SelectedSender); } }
public void RemoveClient(TcpClient client) { var sender = Senders.Where(p => p.Tcp != null && p.Tcp.Equals(client)).FirstOrDefault(); if (sender != null) { sender.Tcp.Close(); Senders.Remove(sender); } }