Esempio n. 1
0
        private void ListView_ItemTapped(object sender, ItemTappedEventArgs e)
        {
            CaveFilter caveFilter = e.Item as CaveFilter;

            parent.pickedDistricts = caveFilter.pickedDistricts;
            parent.pickedRegions   = caveFilter.pickedRegions;
            parent.pickedSites     = caveFilter.pickedSites;

            var index = -1;

            if (caveFilter.caveTypeModel != null)
            {
                index = parent.caveFilterPicker.Items.IndexOf(caveFilter.caveTypeModel.nameEN);
            }
            if (index != -1)
            {
                parent.caveFilterPicker.SelectedIndex = index;
            }

            Navigation.PopAsync();
        }
Esempio n. 2
0
        private void SearchButton_Clicked(object sender, EventArgs e)
        {
            string        selectedCaveTypeName = caveFilterPicker.Items[caveFilterPicker.SelectedIndex];
            CaveTypeModel caveTypeModel        = caveTypeDictionary[selectedCaveTypeName];

            List <CaveModel>  caves         = Kucha.GetCavesByFilters(caveTypeModel, pickedDistricts, pickedRegions, pickedSites);
            List <CaveFilter> searchHistory = Settings.CaveSearchHistorySetting ?? new List <CaveFilter>();
            CaveFilter        caveFilter    = new CaveFilter
            {
                caveTypeModel      = caveTypeModel,
                pickedDistricts    = pickedDistricts,
                pickedRegions      = pickedRegions,
                pickedSites        = pickedSites,
                FoundResultsString = "Results: " + caves.Count,
                SearchTimeString   = "At " + DateTime.UtcNow.ToString()
            };

            searchHistory.Add(caveFilter);
            Settings.CaveSearchHistorySetting = searchHistory.OrderByDescending(x => x.SearchTimeString).ToList();

            Navigation.PushAsync(new CaveSearchResultUI(caves), true);
        }