Forum General


The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

How to navigate to a different content page after a function is called

ikreieikreie Member ✭✭

I have an app that has 2 tabs in Xamarin forms (iOS side). I'd like to know how to make my app navigate to a different content page after a function is called. Let me show you what I mean in code:

these are my two functions in my content page:

 protected override async void OnAppearing()

        async void TakePhotoButton_Clicked()
            if (App.pictureTaken) return;
            App.pictureTaken = true;

            //Allows users to take pictures in the app
            if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported)
                DisplayAlert("No Camera", "Camera is not available.", "OK");

            var file = await CrossMedia.Current.TakePhotoAsync(new Plugin.Media.Abstractions.StoreCameraMediaOptions
                //Sets the properties of the photo file 
                SaveToAlbum = true,
                PhotoSize = PhotoSize.MaxWidthHeight,
                DefaultCamera = CameraDevice.Rear

            if (file == null)

After calling the TakePhotoButton_Clicked() I'd like to force my app to navigate to my other content page.

in pseudocode it would look like:


But im not sure how that would work or if something like that exists. Any suggestions?

Best Answer


  • ikreieikreie Member ✭✭

    @kingwisdoms this takes me to a new page but i also want the tabs to show up at the bottom as well. how do i do that?

  • kingwisdomskingwisdoms Member ✭✭

    Application.Current.MainPage = new NavigationPage(new MyTabbedPage());

    on your TabbedPage .xaml.cs file
    public partial class MyTabbedPage : TabbedPage
    public MyTabbedPage()

            NavigationPage ChurchVisited = new NavigationPage(new ChurchVisited());
            ChurchVisited.Title = "ChurchVisited";
            Children.Add(new Dashboard());
            Children.Add(new ChurchVisited());
Sign In or Register to comment.