public TableViewSource(List<Restaurant> list, MainViewController controller)
 {
     this.list = list;
     mvc = controller;
     sectionTitles = (from r in list
                         orderby r.StartsWith
                         select r.StartsWith).Distinct().ToList();
     foreach (var restaurant in list)
     {	// group elements together into 'alphabet'
         int sectionNumber = sectionTitles.IndexOf(restaurant.Name[0].ToString());
         if (sectionElements.ContainsKey(sectionNumber))
             sectionElements[sectionNumber].Add(restaurant);
         else
             sectionElements.Add(sectionNumber, new List<Restaurant> {restaurant});
     }
 }
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            // Create the main view controller - the 'first' view in the app
            var vc = new MainViewController ();

            // Create a navigation controller, to which we'll add the view
            navigationController = new UINavigationController();
            navigationController.PushViewController(vc, false);
            navigationController.TopViewController.Title ="RestGuide";
            navigationController.NavigationBar.TintColor = UIColor.FromRGB(140/255f, 191/255f, 38/255f);
            navigationController.NavigationBar.BarStyle = UIBarStyle.Black;

            // Create the main window and add the navigation controller as a subview
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.AddSubview(navigationController.View);
            window.MakeKeyAndVisible ();
            return true;
        }
        public override bool FinishedLaunching (UIApplication app, NSDictionary options)
        {
            // Create the main view controller - the 'first' view in the app
            var vc = new MainViewController ();
			
			// Create a navigation controller, to which we'll add the view
			navigationController = new UINavigationController();
			navigationController.PushViewController(vc, false);
			navigationController.TopViewController.Title ="RestGuide";
			navigationController.NavigationBar.TintColor = UIColor.FromRGB(140/255f, 191/255f, 38/255f);
			navigationController.NavigationBar.BarStyle = UIBarStyle.Black;
			
            // Create the main window and add the navigation controller as a subview
            window = new UIWindow (UIScreen.MainScreen.Bounds);
            window.AddSubview(navigationController.View);
            window.MakeKeyAndVisible ();
            return true;
        }
 public TableViewSource(List <Restaurant> list, MainViewController controller)
 {
     this.list     = list;
     mvc           = controller;
     sectionTitles = (from r in list
                      orderby r.StartsWith
                      select r.StartsWith).Distinct().ToList();
     foreach (var restaurant in list)
     {                       // group elements together into 'alphabet'
         int sectionNumber = sectionTitles.IndexOf(restaurant.Name[0].ToString());
         if (sectionElements.ContainsKey(sectionNumber))
         {
             sectionElements[sectionNumber].Add(restaurant);
         }
         else
         {
             sectionElements.Add(sectionNumber, new List <Restaurant> {
                 restaurant
             });
         }
     }
 }
 public RestaurantViewController(MainViewController mvc, Restaurant restaurant) : base()
 {
     rest = restaurant;
 }