void OnListViewItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            DemoContentPage content = Detail as DemoContentPage;

            if (content == null)
            {
                return;
            }

            ListView listView = sender as ListView;

            if (listView == null)
            {
                return;
            }

            content.BindingContext = listView.SelectedItem;
            DemoInfo selected = listView.SelectedItem as DemoInfo;

            if (selected != null)
            {
                this.Detail.Title = selected.Title;
            }
            //this.IsPresented = true;
            if (this.MasterBehavior != MasterBehavior.SplitOnLandscape)
            {
                this.IsPresented = false; // Show the detail page.
            }
        }
        void UpdateContent()
        {
            try {
                SwitchToSystemCulture();
            } catch { }
            DemoInfo info = BindingContext as DemoInfo;

            if (info == null)
            {
                ClearChildren();
                Title = String.Empty;
                return;
            }
            //ClearChildren();

            if (page != null && page is ContentPage)
            {
                ((ContentPage)page).Content = null;
            }

            page = info.CreatePage();
            AssignPageTitle(page, PageDemoName);
            page.Icon = LoadPageIcon(DemoIcon);

            /*
             * ContentPage waitPage = new ContentPage();
             * waitPage.InputTransparent = true;
             * waitPage.BackgroundColor = Color.FromRgba(0, 0, 0, 64);
             * Grid g = new Grid();
             * g.Children.Add(new ActivityIndicator() { IsRunning = true, HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center });
             * waitPage.Content = g;
             *
             * await Navigation.PushModalAsync(waitPage, false);
             *
             * await System.Threading.Tasks.Task.Delay(1000);
             */
            List <Page> pages = new List <Page>();

            AddPage(pages, page);
            if (!info.HideAdditionalPages)
            {
                AddPage(pages, CreateDescriptionPage(page, info));
                AddPage(pages, CreateCSharpCodePage(page));
                AddPage(pages, CreateXamlCodePage(page));
            }
            ReplacePages(pages);

            //ISupportsStartFinish startFinish = page as ISupportsStartFinish;
            //if (startFinish != null)
            //    startFinish.Start();

            //await Navigation.PopModalAsync(false);
        }
 protected override void OnBindingContextChanged()
 {
     base.OnBindingContextChanged();
     if (Device.RuntimePlatform == Device.iOS)
     {
         DemoInfo info = BindingContext as DemoInfo;
         if (info != null)
         {
             if (!string.IsNullOrEmpty(info.ShortDescription))
             {
                 Height = 80;
             }
         }
     }
 }
        Page CreateDescriptionPage(Page demoPage, DemoInfo info)
        {
            if (info == null)
            {
                return(null);
            }

            HtmlViewerPage result = new HtmlViewerPage();

            AssignPageTitle(result, PageDescriptionName);
            result.ObtainSourceDelegate = () => {
                string htmlString = LoadDescriptionHtml(demoPage, ".html");
                if (String.IsNullOrEmpty(htmlString))
                {
                    return(null);
                }
                return(new HtmlWebViewSource()
                {
                    Html = ProcessHtmlString(htmlString)
                });
            };
            result.Icon = LoadPageIcon(DescriptionIcon);
            return(result);
        }