示例#1
0
        public MainPage()
        {
            Page home, About, Trade, myTrade, Notification = null;

            if (Settings.AuthLoginToken.Equals(string.Empty))
            {
                home = new HomeAndroid()
                {
                    Title = "Home"
                };
                About = new Account()
                {
                    Title = "Account"
                };

                Children.Add(home);
                Children.Add(About);

                Title = Children[0].Title;
            }
            else
            {
                home = new HomeAndroid()
                {
                    Title = "Home"
                };
                Trade = new TradePage()
                {
                    Title = "Trade"
                };
                myTrade = new MyTrade()
                {
                    Title = "My Trade"
                };
                Notification = new TabView()
                {
                    Title = "Notificatin"
                };
                About = new Account()
                {
                    Title = "Account"
                };

                Children.Add(home);
                Children.Add(Trade);
                Children.Add(myTrade);
                Children.Add(Notification);
                Children.Add(About);

                Title = Children[0].Title;
            }
        }
示例#2
0
        public void Selected(string item)
        {
            switch (item)
            {
            case "Home":
                if (Device.RuntimePlatform == Device.iOS)
                {
                    if (home == null)
                    {
                        home = new NavigationPage(new Home());
                    }
                }
                else
                {
                    if (home == null)
                    {
                        home = new Home();
                    }
                }

                rootPage.Detail = home;
                rootPage.Title  = "Home";
                break;

            case "Trade":
                if (Device.RuntimePlatform == Device.iOS)
                {
                    Trade = new NavigationPage(new TradePage());
                }
                else
                {
                    Trade = new TradePage();
                }
                rootPage.Detail = Trade;
                rootPage.Title  = "Trade";
                break;

            case "MyTrade":
                if (Device.RuntimePlatform == Device.iOS)
                {
                    myTrade = new NavigationPage(new MyTrade());
                }
                else
                {
                    myTrade = new MyTrade();
                }
                rootPage.Detail = myTrade;
                rootPage.Title  = "My Trade";
                break;

            case "Notification":
                if (Device.RuntimePlatform == Device.iOS)
                {
                    Notification = new NavigationPage(new TabView());
                }
                else
                {
                    Notification = new TabView();
                }
                rootPage.Detail = Notification;
                rootPage.Title  = "Notificatin";
                break;

            case "About":
                About = new AboutPage()
                {
                    // BarBackgroundColor = App.BrandColor,
                    ///// BarTextColor = Color.White
                };
                rootPage.Detail = About;
                break;
            }
            ;
            rootPage.IsPresented = false;  // close the slide-out
        }