After photo gallery browsing it goes back to the first page
-
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");
return;
}
var file = await CrossMedia.Current.PickPhotoAsync(new Plugin.Media.Abstractions.PickMediaOptions
{
PhotoSize = Plugin.Media.Abstractions.PhotoSize.Medium
});if (file == null) return; filePath = file.Path; paths.Enqueue(filePath); //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(() => { var stream = file.GetStream(); return stream; }); imagepopup.IsOpen = true; }
Thanks
Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vimalsoft.com vuyiswa[at]vimalsoft.com