public ProducerListViewModel(BLC.BLC blc, Action <int> tab_no) { this.blc = blc; _tab_no = tab_no; ProducersList = new ObservableCollection <ProducerViewModel>( blc.GetProducers().Select(p => new ProducerViewModel(p))); AddProducerCommand = new RCommand(_ => AddProducer()); }
public InstrumentListViewModel(BLC.BLC blc, Action <int> tab_no, ObservableCollection <ProducerViewModel> producers) { this.blc = blc; _tab_no = tab_no; Instruments = new ObservableCollection <InstrumentViewModel>( blc.GetInstruments().Select(p => new InstrumentViewModel(p))); CreateInstrumentCommand = new RCommand(_ => CreateInstrument()); DeleteInstrumentCommand = new RCommand(_ => DeleteInstrument(), _ => CurrentInstrument != null); SaveInstrumentCommand = new RCommand(_ => SaveInstrument(), _ => CurrentInstrument != null); AvailableProducers = producers; }