After photo gallery browsing it goes back to the first page RRS feed

  • Question

  • Good Day

    in my Xamarin page i have a button that browse the gallery to allow a user to bind it to an image editor , after selecting the image , the page refreshes to the first page that led to this current page. i would like to make it keep it in the current page after image selection . below is the code on my button

    async private void Btnupload_Clicked(object sender, EventArgs e)
                GenericMethods.IS_IMAGE_SELECTON = true;
                    if (!CrossMedia.Current.IsPickPhotoSupported)
                        await DisplayAlert("Photos Not Supported", ":( Permission not granted to photos.", "OK");
                    var file = await CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
                        PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium
                    if (file == null)
                    filePath = file.Path;
                    //Linux path 
                    readytosave = GenericMethods.StreamToByteArray(file.GetStream());
                    Uri uri = new Uri(file.Path);
                    filename = string.Empty;
                    if (uri.IsFile)
                        filename = System.IO.Path.GetFileName(uri.LocalPath);
                    var extension = filename.Split('.')[1].ToLower();
                    file_extension = extension;
                     imageEditor.Source = ImageSource.FromStream(() =>
                        v ar stream = file.GetStream();
                        return stream;
                imagepopup.IsOpen = true;
    i have an example project here https://us.v-cdn.net/5019960/uploads/editor/i6/o5sb6dwnx97a.zip 


    Vuyiswa Maseko

    Thursday, May 30, 2019 9:15 PM

All replies

  • Hi Vuyiswa Maseko,

    Welcome to the MSDN forum.

    According to the description, this issue is about the Xamarin development and our forum is to discuss the VS IDE, please redirect to this appropriate forum: https://forums.xamarin.com/ for better support, thanks for your understanding.

    Best regards,


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Monday, June 3, 2019 7:35 AM