Exemplo n.º 1
0
		public CoreMasterDetailPage ()
		{
			AutomationId = "MasterDetailPageRoot";

			var toCrashButton = new Button {Text = "Crash Me"};

			var masterPage = new ContentPage {Title = "Menu", Icon = "bank.png", Content = toCrashButton};
			var detailPage = new CoreRootPage (this, NavigationBehavior.PushModalAsync) { Title = "DetailPage" };

			bool toggle = false;
			toCrashButton.Clicked += (sender, args) => {
				if (toggle)
					Detail = new ContentPage { BackgroundColor = Color.Green, };
				else
					Detail = detailPage;

				toggle = !toggle;
			};

			Master = masterPage;
			Detail = detailPage;
		}
Exemplo n.º 2
0
        public CoreMasterDetailPage()
        {
            AutomationId = "MasterDetailPageRoot";

            var toCrashButton = new Button {
                Text = "Crash Me"
            };

            var masterPage = new ContentPage {
                Title = "Menu", IconImageSource = "bank.png", Content = toCrashButton
            };
            var detailPage = new CoreRootPage(this, NavigationBehavior.PushModalAsync)
            {
                Title = "DetailPage"
            };

            bool toggle = false;

            toCrashButton.Clicked += (sender, args) =>
            {
                if (toggle)
                {
                    Detail = new ContentPage {
                        BackgroundColor = Color.Green,
                    }
                }
                ;
                else
                {
                    Detail = detailPage;
                }

                toggle = !toggle;
            };

            Master = masterPage;
            Detail = detailPage;
        }