示例#1
0
        private async void FilterHasChanged(FilterHasChangedEventArgs obj)
        {
            //Since filter is used after any field got changed, we need to make sure
            //that we are not running more than one process at the time
            if (_isFilterWorking == false)
            {
                _isFilterWorking = true;
                var cars = await _carRepository.ApplyFilterAsync(CarFiltersViewModel);

                Cars.Clear();
                foreach (var car in cars)
                {
                    Cars.Add(new CarListItemViewModel(car, _eventAggregator));
                }
                _isFilterWorking = false;
            }
        }