Exemplo n.º 1
0
        public MainPage()
        {
            InitializeComponent();

            // get the samples for this platform
            var samples  = GetPlatformSamples();
            var showcase = samples.First(s => s.Category.HasFlag(SampleCategories.Showcases));

            var detailContents = new DetailContentsPage(showcase);
            var detailsPage    = new DetailsPage(detailContents);
            var masterPage     = new MasterPage(samples);

            masterPage.SampleSelected += sample =>
            {
                detailsPage.Sample = sample;

                IsPresented = false;
            };
            detailsPage.PlaySamples += delegate { masterPage.CycleSamples(); };

            if (Device.RuntimePlatform == "Tizen")
            {
                var hamburger = new ToolbarItem
                {
                    IconImageSource = "hamburger.png",
                    Order           = ToolbarItemOrder.Secondary
                };
                hamburger.Clicked += delegate { IsPresented = !IsPresented; };
                detailsPage.ToolbarItems.Add(hamburger);
            }

            Master = masterPage;
            Detail = detailsPage;
        }
Exemplo n.º 2
0
        public MainPage()
        {
            InitializeComponent();

            // get the samples for this platform
            var samples  = GetPlatformSamples();
            var showcase = samples.First(s => s.Category.HasFlag(SampleCategories.Showcases));

            var detailContents = new DetailContentsPage(showcase);
            var detailsPage    = new DetailsPage(detailContents);
            var masterPage     = new MasterPage(samples);

            masterPage.SampleSelected += sample =>
            {
                detailsPage.Sample = sample;

                IsPresented = false;
            };
            detailsPage.PlaySamples += delegate { masterPage.CycleSamples(); };

            Master = masterPage;
            Detail = detailsPage;
        }