public void DeleteSignal(SinGenerator signal) { var i = Signals.IndexOf(signal); if (i >= 0) { DeleteSignal(i); } }
//public SinSignal GetSignalById(int id) //{ // return Signals.Where(s => s.ID == id).First(); //} //public void DeleteSignalById(int id) //{ // var index = Signals.Where(s => s.ID == id).First().ID; // Signals.RemoveAt(id); //} public void DeleteSignal(SinSignal signal) { var i = Signals.IndexOf(signal); if (i >= 0) { Signals.RemoveAt(i); } //if (AddedSignal != null) // DeletedSignal(signal); }
public async void EditSignal(object model) { Debug.Assert(model is SignalDisplayModel); var signalDisplayModel = (NumericSignalModel)model; if (Signals.Contains(model)) { var view = new EditSignalView(); var viewModel = new EditSignalViewModel(signalDisplayModel); ViewModelBinder.Bind(viewModel, view, null); await DialogHost.Show(view, "MainDialogHost"); if (viewModel.DoSave) { int index = Signals.IndexOf(viewModel.Model); if (index >= 0) { Signals[index] = viewModel.Model; } } } }