예제 #1
0
        internal void RefreshMenu()
        {
            FilteredServices.Clear();
            var items = Services.Where(s => s.Visibility);

            foreach (var s in items)
            {
                FilteredServices.Add(s);
            }
        }
        public void Refresh()
        {
            _services = connection.GetServices();

            // before  FilteredCars.Clear() the SelectedCar needs to point to a valid location
            // (with  FilteredCars.Clear(), the referenced object will disappear, and will give error at Display Fields)
            SelectedService = null;
            FilteredServices.Clear();

            _services.ForEach(x => FilteredServices.Add(x));
            ClearFields();
        }
        public void Filter()
        {
            if (string.IsNullOrEmpty(FilterType) && string.IsNullOrEmpty(FilterName) && string.IsNullOrEmpty(FilterTime) && string.IsNullOrEmpty(FilterPrice))
            {
                Refresh();
                return;
            }

            _services = connection.GetServices();
            // before  FilteredCars.Clear() the SelectedCar needs to point to a valid location
            // (with  FilteredCars.Clear(), the referenced object will disappear, and will give error at Display Fields)
            SelectedService = null;
            FilteredServices.Clear();

            List <Service> temp = new List <Service>();

            temp = FilterByType(_services);
            temp = FilterByName(temp);
            temp = FilterByTime(temp);
            temp = FilterByPrice(temp);
            temp.ForEach(x => FilteredServices.Add(x));
        }