Ejemplo n.º 1
0
        private void UpdateProductsListview()
        {
            IsBusy = true;
            var query = DataStore.GetDataStoredJson("Products").ToList();

            if (query.Count > 0)
            {
                var _products = JsonConvert.DeserializeObject <List <Products_Model> >(query[0].json);
                Products.Clear();
                Filtred_List.Clear();
                foreach (var product in _products)
                {
                    if (Products_Presented_Ids != null && Products_Presented_Ids.Count > 0)
                    {
                        if (!Products_Presented_Ids.Contains(product._id))
                        {
                            Products.Add(product);
                            Filtred_List.Add(product);
                        }
                    }
                    else
                    {
                        Products.Add(product);
                        Filtred_List.Add(product);
                    }
                }
                SearchBarText = string.Empty;
            }
            IsBusy = false;
        }
Ejemplo n.º 2
0
 private void ExecuteOnSearch()
 {
     if (string.IsNullOrWhiteSpace(SearchBarText))
     {
         Filtred_List = new ObservableCollection <Products_Model>(Products);
     }
     else
     {
         var _filtred_List = Products.Where(i => i.name.ToLower().Contains(SearchBarText.ToLower())).ToList();
         Filtred_List.Clear();
         foreach (var product in _filtred_List)
         {
             Filtred_List.Add(product);
         }
     }
 }