예제 #1
0
 async void DisplaySearchResults()
 {
     try {
         Task <string> getSearchJson = Utilities.GetSearchJson("event", EventsNavSearchBar.Text);
         var           searchItems   = JsonConvert.DeserializeObject <List <Game> >(await getSearchJson);
         parsedEventsJson = new Dictionary <string, List <Game> >();
         parsedEventsJson.Add("Found " + searchItems.Count() + " Result(s)", searchItems);
         TableView.Source = new EventTableSource(parsedEventsJson);
         TableView.Hidden = false;
         if (IsViewLoaded && View.Window != null && EventsNavSearchBar.Alpha.Equals(1))
         {
             TableView.ReloadData();
             UIView.AnimateNotify(0.4, 0, 0.65f, 0f, UIViewAnimationOptions.CurveEaseIn, delegate {
                 EventsNavCloseBtn.Transform             = Utilities.Show;
                 EventsNavSearchLoadingSpinner.Transform = Utilities.Hide;
                 TableView.Alpha = 1;
             }, delegate { EventsNavSearchLoadingSpinner.StopAnimating(); });
         }
     }
     catch {
         UIAlertView alert = new UIAlertView("Error", "Problem connecting.\n" +
                                             "Please check your connection and try again.", null, "OK", null);
         alert.Show();
         EventsNavCloseBtn.Transform = Utilities.Show;
         EventsNavSearchLoadingSpinner.StopAnimating();
     }
 }
예제 #2
0
 public override void ViewDidDisappear(bool animated)
 {
     base.ViewDidDisappear(animated);
     TableView.Alpha = 1;
     EventsNavSearchBtn.Transform = Utilities.Show;
     EventsTitleLbl.Transform     = Utilities.Show;
     EventsNavCloseBtn.Hidden     = true;
     EventsNavSearchBar.Hidden    = true;
     EventsNavSearchLoadingSpinner.StopAnimating();
 }