示例#1
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this 
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //



        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);


            Util.VisualMode = VisualMode.None;
            //Util.VisualMode = VisualMode.TintColor;
            //Util.VisualMode = VisualMode.UIAppearance;
            AppearanceManager.SetAppearance();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;
            
            tabBar = new UITabBarController();
            loginDvc = new LoginDialogViewController();


            //have a look at the ExpenseModel class to see why it's hard to do 
            // theming on MonoTouch.Dialog auto-generated stuff
            var expense = new ExpenseModel();
            var context = new BindingContext(null, expense, "Expenses");
            expenseDvc = new BaseDialogViewController(context.Root);
            expenseDvc.Title = "Expenses";
            
            var tabControllers = new UINavigationController[] {
            

                new UINavigationController(loginDvc) {
                    TabBarItem = new UITabBarItem("Login", Resources.Padlock, 1)
                },
                new UINavigationController(expenseDvc) {
                    TabBarItem = new UITabBarItem("Expenses", Resources.Expense, 2)
                }


                /*
                new UINavigationController(deadlines) {
                    TabBarItem = new UITabBarItem("Deadlines", Resources.Deadlines, 2)
                },
                new UINavigationController(reports) {
                    TabBarItem = new UITabBarItem("Reports", Resources.Deadlines, 4)
                },
                new UINavigationController(you) {
                    TabBarItem = new UITabBarItem("You", Resources.You, 3)
                }
                */

                
            };
            
            tabBar.SetViewControllers(tabControllers, false);
            

            window.RootViewController = tabBar;
            window.MakeKeyAndVisible ();
			
            return true;
        }
示例#2
0
        //
        // This method is invoked when the application has loaded and is ready to run. In this
        // method you should instantiate the window, load the UI into it and then make the window
        // visible.
        //
        // You have 17 seconds to return from this method, or iOS will terminate your application.
        //



        public override bool FinishedLaunching(UIApplication app, NSDictionary options)
        {
            window = new UIWindow(UIScreen.MainScreen.Bounds);


            Util.VisualMode = VisualMode.None;
            //Util.VisualMode = VisualMode.TintColor;
            //Util.VisualMode = VisualMode.UIAppearance;
            AppearanceManager.SetAppearance();

            UIApplication.SharedApplication.StatusBarStyle = UIStatusBarStyle.BlackOpaque;

            tabBar   = new UITabBarController();
            loginDvc = new LoginDialogViewController();


            //have a look at the ExpenseModel class to see why it's hard to do
            // theming on MonoTouch.Dialog auto-generated stuff
            var expense = new ExpenseModel();
            var context = new BindingContext(null, expense, "Expenses");

            expenseDvc       = new BaseDialogViewController(context.Root);
            expenseDvc.Title = "Expenses";

            var tabControllers = new UINavigationController[] {
                new UINavigationController(loginDvc)
                {
                    TabBarItem = new UITabBarItem("Login", Resources.Padlock, 1)
                },
                new UINavigationController(expenseDvc)
                {
                    TabBarItem = new UITabBarItem("Expenses", Resources.Expense, 2)
                }


                /*
                 * new UINavigationController(deadlines) {
                 *  TabBarItem = new UITabBarItem("Deadlines", Resources.Deadlines, 2)
                 * },
                 * new UINavigationController(reports) {
                 *  TabBarItem = new UITabBarItem("Reports", Resources.Deadlines, 4)
                 * },
                 * new UINavigationController(you) {
                 *  TabBarItem = new UITabBarItem("You", Resources.You, 3)
                 * }
                 */
            };

            tabBar.SetViewControllers(tabControllers, false);


            window.RootViewController = tabBar;
            window.MakeKeyAndVisible();

            return(true);
        }
        public override void LoadView()
        {
            base.LoadView();

            RootElement root = new RootElement(Title);

            //you can also pass a view into the section, which makes putting in a new gradient seperator easy!
            // if you want the text, tho, you DO need to add your own UILabel.
            root.Add(new Section("")
            {
                (firstElement = new StyledStringElement("Address Book Viewer", "Show it!")
                {
                    Accessory = UITableViewCellAccessory.DisclosureIndicator
                }),
                (secondElement = new StyledStringElement("Push another of the same", DateTime.Now.ToString("hh:MM:ss"))
                {
                    Accessory = UITableViewCellAccessory.DisclosureIndicator
                })
            });

            firstElement.Tapped += delegate() {
                //lets throw up a contact picker, so we can show that the UIAppearance sticks
                ShowContactPicker();
            };

            secondElement.Tapped += delegate {
                var lv = new LoginDialogViewController(true);
                NavigationController.PushViewController(lv, true);
            };


            Root = root;

            //get rid of the nasty lines under our items
            TableView.TableFooterView = new UIView()
            {
                BackgroundColor = UIColor.Clear
            };
        }
        public override void LoadView()
        {
            base.LoadView();

            RootElement root = new RootElement(Title);

            //you can also pass a view into the section, which makes putting in a new gradient seperator easy!
            // if you want the text, tho, you DO need to add your own UILabel.
            root.Add(new Section("") {
                (firstElement = new StyledStringElement("Address Book Viewer", "Show it!") {
                    Accessory = UITableViewCellAccessory.DisclosureIndicator
                }),
                (secondElement = new StyledStringElement("Push another of the same", DateTime.Now.ToString("hh:MM:ss")) {
                    Accessory = UITableViewCellAccessory.DisclosureIndicator
                })
            });

            firstElement.Tapped += delegate() {
                //lets throw up a contact picker, so we can show that the UIAppearance sticks
                ShowContactPicker();

            };

            secondElement.Tapped += delegate {
                var lv = new LoginDialogViewController(true);
                NavigationController.PushViewController(lv, true);
            };


            Root = root;

            //get rid of the nasty lines under our items
            TableView.TableFooterView = new UIView() {
                BackgroundColor = UIColor.Clear
            };

        }