Beispiel #1
0
        public CarsViewModel(ShellViewModel.SelectedCarChanged notifyCarChanged, ShellViewModel.ScreenStateChanged notifySSChanged, ShellViewModel.ErrorHandler notifyError)
        {
            _notifyCarChanged = notifyCarChanged;
            _notifySSChanged  = notifySSChanged;
            _notifyError      = notifyError;

            BindingList <CarModel> _cars;

            try
            {
                _carList = DataAccess.GetCars();
            }
            catch (Exception e)
            {
                notifyError(e);
                return;
            }

            _carList.Sort();

            _cars = new BindingList <CarModel>(_carList); // load up cars from DB
            _cars.RaiseListChangedEvents = true;
            SortedCars = new BindingListCollectionView(_cars);
        }
Beispiel #2
0
 public ReportViewModel(ShellViewModel.ScreenStateChanged screenStateChanged, ShellViewModel.ErrorHandler notifyError)
 {
     _screenStateChanged = screenStateChanged;
     _notifyError        = notifyError;
 }