コード例 #1
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            Page newRoot = null;

            var btn = (Button)sender;

            if (btn.Text == "ViewA")
            {
                newRoot = new ViewA();
            }
            else
            {
                newRoot = new ViewB();
            }

            await _navPage.Navigation.PushAsync(newRoot);

            IsPresented = false;
        }
コード例 #2
0
        private async void Button_Clicked(object sender, EventArgs e)
        {
            Page root = _navPage.Navigation.NavigationStack[0];

            await _navPage.Navigation.PopToRootAsync(false);

            Page newRoot = null;

            var btn = (Button)sender;

            if (btn.Text == "ViewA")
            {
                newRoot = new ViewA();
            }
            else
            {
                newRoot = new ViewB();
            }

            await _navPage.Navigation.PushAsync(newRoot);

            _navPage.Navigation.RemovePage(root);
        }