Наследование: ContentPage
Пример #1
0
        public App()
        {
            Analytics         = new PiwikAnalytics("http://mockbin.org/bin/9ac466a2-313c-4691-bf74-f15b9ab602b2", 13);
            Analytics.Verbose = true;
            Analytics.AppUrl  = "http://demoapp";

            var content = new PiwikPage {
                Title   = "Demo",
                Content = new StackLayout {
                    VerticalOptions = LayoutOptions.Center,
                    Children        =
                    {
                        new Label                                           {
                            HorizontalTextAlignment = TextAlignment.Center,
                            Text = "Xamarin.Piwik Tracker Demo App\n\nBrowse to\nhttps://goo.gl/tHhz23\nto see the api calls"
                        },
                        new Button                                          {
                            Text    = "Open SubPage",
                            Command = new Command(() =>                     {
                                MainPage.Navigation.PushAsync(new PiwikPage {
                                    Title = "SubPage",
                                });
                            }),
                        },
                        new Button                                          {
                            Text    = "Track Event",
                            Command = new Command(() => Analytics.TrackEvent("User Action", "Button Pressed")),
                        }
                    }
                }
            };

            var navigation = new NavigationPage(content);

            navigation.Pushed += (sender, e) => TrackCurrentPage();
            navigation.Popped += (sender, e) => TrackCurrentPage();
            MainPage           = navigation;
        }