public void RemoveNetwork(string name) { var network = Networks.SingleOrDefault(e => e.Name == name); if (network != null) { Networks.Remove(network); OnNetworkRemove?.Invoke(network); } }
public async void RemoveNetwork() { var mySettings = new MetroDialogSettings() { AffirmativeButtonText = "Delete", NegativeButtonText = "Cancel" }; var result = await _coordinator.ShowMessageAsync(Parent, "Remove Network?", $"Are you sure you want to remove the network: {SelectedNetwork.Name}?", MessageDialogStyle.AffirmativeAndNegative, mySettings); if (result == MessageDialogResult.Affirmative) { Networks.Remove(SelectedNetwork); SelectedNetwork = Networks.FirstOrDefault(); } }
public bool RemoveNetwork(NetworkSettings network) { return(Networks.Remove(network)); }
public void RemoveInstance(Guid id) { Networks.Remove(Networks.FirstOrDefault(i => i.Id == id)); OnPropertyChanged(nameof(Networks)); }