public AllCustomerViewModel()
        {
            _list = new ObservableCollection<Customer>();
            List<Customer> _cList = new CustomerRepository()._customerList;

            foreach (Customer item in _cList)
            {
                this.AllCustomerList.Add(item);
            }

            // Initialize Commands of the View
            this.SetStart = new AllCustomerViewModelCommand(ExecuteSetStart, CanExecuteSetStart);
            this.SetStop = new AllCustomerViewModelCommand(ExecuteSetStop, CanExecuteSetStop);

            // Setting up the timer for updating data on recurring basis
            SimulatorTimer.Elapsed += new ElapsedEventHandler(RunSimulatorEvent);
            SimulatorTimer.Interval = 5000;
            SimulatorTimer.Start();
        }
예제 #2
0
 public CustomerViewModel()
 {
     _cRepository = new CustomerRepository();
     this.MyCustomer = _cRepository._customerList.FirstOrDefault();
 }