示例#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;
        }
示例#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()));
        }