Silverlight windows phone 8.1 FileOpenPicker for all files Continue not working

57 Views Asked by At

i create silverlight windows phone 8.1 project and i need to choose all kind of file from windows phone

i used FileOpenPicker for choose the file it redirect correctly and i can choose the file this is my code

       FileOpenPicker openPicker = new FileOpenPicker();
        openPicker.ViewMode = PickerViewMode.List;
        openPicker.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;

        openPicker.FileTypeFilter.Add("*");
        openPicker.PickMultipleFilesAndContinue();

And i follow this msdn for receiving select

In my case if i selecting file and come back to the app its every thing working if i without select any file and come back using mobile hardware back button my app come to home screen. but it need to stay file picker page

my first pageFirst page

second page

Third page

when i press mobile hardware back button in above screen the page redirect to my first page it need to stay in my second page

thanks

1

There are 1 best solutions below

1
Manikandan On BEST ANSWER

Finally i got the answer and avoid redirection

 bool reset;
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {

            if(reset && e.uri.tostring().Equals("MainPage.xaml"))
             {
                e.Cancel = true;
                reset = false
             }


        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

            reset = e.NavigationMode == NavigationMode.Reset;
        }