Ejemplo n.º 1
0
        private void Sorting(ROMs temp)
        {
            temp.SortByName();
            object objSortType;

            if (!App.Current.Properties.TryGetValue("SortType", out objSortType))
            {
                objSortType = SortTypes.Name;
            }
            if ((SortTypes)objSortType == SortTypes.Base)
            {
                temp.SortByBase();
            }
            ROMList.ItemsSource = temp;
        }
Ejemplo n.º 2
0
        private async void SearchBar_TextChanged(object sender, TextChangedEventArgs e)
        {
            SearchBar searchBar = (SearchBar)sender;
            object    json      = "";

            if (!App.Current.Properties.TryGetValue("json", out json))
            {
                await DisplayAlert(Utils.GetError("Error"), Utils.GetError("ErrorNoInternet"), "OK");

                return;
            }
            ROMs temp = new ROMs(JsonConvert.DeserializeObject <List <ROM> >((string)json));

            temp.SortByName();
            ROMList.ItemsSource = temp.Where(x => x.Name.ToLowerInvariant().Contains(e.NewTextValue.ToLowerInvariant()));
        }
Ejemplo n.º 3
0
        private void SetItemsSource(string json)
        {
            ROMs temp = new ROMs(JsonConvert.DeserializeObject <List <ROM> >((string)json));

            Sorting(temp);
        }