Beispiel #1
0
        //send info to the  SearchFragmentActual fragment to execute the search queries
        public void createResultsFragment(string option, string searchedString)
        {
            searchResultsPage resultsPage = new searchResultsPage();

            Bundle args = new Bundle();

            args.PutString("option", option);
            args.PutString("searchedString", searchedString);
            resultsPage.Arguments = args;

            FragmentTransaction fragmentTransaction = this.Activity.FragmentManager.BeginTransaction();

            fragmentTransaction.Replace(Resource.Id.frame, resultsPage);
            fragmentTransaction.AddToBackStack("SearchFragmentActual");
            fragmentTransaction.Commit();
        }
Beispiel #2
0
        void button_Click_Apply(object sender, EventArgs e)
        {
            if (distanceBox.Checked)
            {
                sort = "distance";
            }
            else if (ratingBox.Checked)
            {
                sort = "rating";
            }
            else if (mostPopBox.Checked)
            {
                sort = "popular";
            }
            else if (lowPriceBox.Checked)
            {
                sort = "low";
            }
            else if (highPriceBox.Checked)
            {
                sort = "high";
            }

            if (noDietary.Checked)
            {
                dietary = "none";
            }
            else if (veganBox.Checked)
            {
                dietary = "vegan";
            }
            else if (vegetarianBox.Checked)
            {
                dietary = "vegetarian";
            }
            else if (glutenFreeBox.Checked)
            {
                dietary = "glutenfree";
            }

            if (OpenNowSwitch.Checked)
            {
                openNow = "yes";
            }
            else
            {
                openNow = "no";
            }

            //send refinements to search results page
            searchResultsPage fragment = new searchResultsPage();
            Bundle            args     = new Bundle();

            args.PutString("sort", sort);
            args.PutString("dietary", dietary);
            args.PutString("openNow", openNow);
            args.PutString("option", option);
            args.PutString("searchedString", searchedString);
            fragment.Arguments = args;

            var fragmentTransaction = FragmentManager.BeginTransaction();

            fragmentTransaction.Replace(Resource.Id.frame, fragment);

            FragmentManager.PopBackStackImmediate();
            fragmentTransaction.AddToBackStack("SearchFragmentActual");

            fragmentTransaction.Commit();
        }