示例#1
0
 public App()
 {
     InitializeComponent ();
     database = new POCDB ();
     MainPage = new NavigationPage (new WorkingWithBindings());
     //MainPage = new NavigationPage (new Login());
 }
示例#2
0
        public App1()
        {
            InitializeComponent ();
            var goXamlButton = new Button { Text = "Go With Xaml" };
            goXamlButton.Clicked += (sender, e) => {
                database = new POCDB ();
                var mainNav = new NavigationPage (new RandomThings());
                MainPage = mainNav;
            };

            var goCodeButton = new Button { Text = "Go With Code Only" };
            goCodeButton.Clicked += (sender, e) => {
                database = new POCDB ();
                var mainNav = new NavigationPage (new TodoListPage());
                MainPage = mainNav;
            };

            // The root page of your application
            MainPage = new ContentPage {
                Content = new StackLayout {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        new Label {
                            XAlign = TextAlignment.Center,
                            Text = "Welcome to Xamarin Forms!"
                        },
                        goCodeButton,
                        goXamlButton
                    }
                }
            };
        }