/// <summary>
        /// Called when the DetailDisclosureButton is touched.
        /// Does nothing if DetailDisclosureButton isn't in the cell
        /// </summary>
        public override void AccessoryButtonTapped(UITableView tableView, NSIndexPath indexPath)
        {
            if (tableItems[indexPath.Row].Heading == "Overview")
            {
                UIAlertController okAlertController = UIAlertController.Create("Overview", "Reading a recipe can feel like reading a foreign language; here are common words in recipes - and what they mean;", UIAlertControllerStyle.Alert);
                okAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));
                owner.PresentViewController(okAlertController, true, null);

                tableView.DeselectRow(indexPath, true);
            }
            if (tableItems[indexPath.Row].Heading == "Sharp Tools")
            {
                UIStoryboard board = UIStoryboard.FromName("Main", null);
                KSSharpToolsViewController ctrl = (KSSharpToolsViewController)board.InstantiateViewController("KSSharpToolsViewController");
                owner.NavigationController.PushViewController(ctrl, true);
            }
            if (tableItems[indexPath.Row].Heading == "Bowls")
            {
                UIStoryboard          board = UIStoryboard.FromName("Main", null);
                KSBowlsViewController ctrl  = (KSBowlsViewController)board.InstantiateViewController("KSBowlsViewController");
                owner.NavigationController.PushViewController(ctrl, true);
            }
            if (tableItems[indexPath.Row].Heading == "Heat")
            {
                UIStoryboard         board = UIStoryboard.FromName("Main", null);
                KSHeatViewController ctrl  = (KSHeatViewController)board.InstantiateViewController("KSHeatViewController");
                owner.NavigationController.PushViewController(ctrl, true);
            }
        }
예제 #2
0
 public TableSourceKSBowls(List <TableItem> items, KSBowlsViewController owner)
 {
     tableItems = items;
     this.owner = owner;
 }