示例#1
0
        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();
            }
        }
示例#3
0
 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));
 }