コード例 #1
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			MenuViewController menuViewController = new MenuViewController(UITableViewStyle.Grouped);
			DetailsViewController detailsViewController = new DetailsViewController();
			UINavigationController navController = new UINavigationController (detailsViewController);

			SlideMenuController slideMenuViewController = new SlideMenuController();
			slideMenuViewController.SetContentViewController (navController);
			slideMenuViewController.SetLeftMenuViewController (menuViewController);

			UINavigationController cont = new UINavigationController (new MenuViewController (UITableViewStyle.Plain));

			slideMenuViewController.SetRightMenuViewController (cont);

			if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad) {
				slideMenuViewController.WidthOfPortraitContentViewVisible = 300f;
				slideMenuViewController.WidthOfLandscapeContentViewVisible = 556f;
			}

			window.RootViewController = slideMenuViewController;

			window.BackgroundColor = UIColor.White;
			window.MakeKeyAndVisible ();			
			return true;
		}
コード例 #2
0
        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);

            MenuViewController     menuViewController    = new MenuViewController(UITableViewStyle.Grouped);
            DetailsViewController  detailsViewController = new DetailsViewController();
            UINavigationController navController         = new UINavigationController(detailsViewController);

            SlideMenuController slideMenuViewController = new SlideMenuController();

            slideMenuViewController.SetContentViewController(navController);
            slideMenuViewController.SetLeftMenuViewController(menuViewController);

            UINavigationController cont = new UINavigationController(new MenuViewController(UITableViewStyle.Plain));

            slideMenuViewController.SetRightMenuViewController(cont);

            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                slideMenuViewController.WidthOfPortraitContentViewVisible  = 300f;
                slideMenuViewController.WidthOfLandscapeContentViewVisible = 556f;
            }

            window.RootViewController = slideMenuViewController;

            window.BackgroundColor = UIColor.White;
            window.MakeKeyAndVisible();
            return(true);
        }
		//			- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
		//			{
		//				if (self.slideMenuController)
		//				{
		//					DetailsViewController *detailsVC = [DetailsViewController new];
		//					detailsVC.detailedObject = indexPath;
		//					
		//					if (indexPath.section == 0 && indexPath.row == 1)
		//					{
		//						[detailsVC setOnShowMenuButtonClicked:^{
		//							[self dismissModalViewControllerAnimated:YES];
		//						 }];
		//						[self presentViewController:detailsVC animated:YES completion:nil];
		//					}
		//					else
		//					{
		//						UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:detailsVC];
		//						[self.slideMenuController setContentViewController:navController animated:YES completion:nil];
		//						[navController release];
		//					}
		//					
		//					[detailsVC release];
		//				}
		//				else
		//				{
		//					[tableView deselectRowAtIndexPath:indexPath animated:YES];
		//				}
		//			}
		
		public override void RowSelected (UITableView tableView, NSIndexPath indexPath)
		{
			var smc = controller.SlideMenuController ();
			if (smc != null) {
				var detailsViewController = new DetailsViewController();
				UINavigationController navController = new UINavigationController(detailsViewController);
				smc.SetContentViewControllerAnimated(navController, true, null);
			} else {
				tableView.DeselectRow(indexPath, true);
			}
		}
コード例 #4
0
		public override bool FinishedLaunching (UIApplication app, NSDictionary options)
		{
			window = new UIWindow (UIScreen.MainScreen.Bounds);

			MenuViewController menuViewController = new MenuViewController(UITableViewStyle.Grouped);
			DetailsViewController detailsViewController = new DetailsViewController();

			SlideMenuController slideMenuViewController = new SlideMenuController(menuViewController, detailsViewController);

			window.RootViewController = slideMenuViewController;

			window.BackgroundColor = UIColor.White;
			window.MakeKeyAndVisible ();			
			return true;
		}