예제 #1
0
        public void DeleteSignal(SinGenerator signal)
        {
            var i = Signals.IndexOf(signal);

            if (i >= 0)
            {
                DeleteSignal(i);
            }
        }
예제 #2
0
        //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);
        }
예제 #3
0
        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;
                    }
                }
            }
        }