[RESOLVED] WP7 - OnBackKeyPress Dispose()?
I'm trying to cleanup unused items but so far no luck...it's quite annoying some forms not to be closed when the back button is pressed. The test application acts just like a browser.
used code
Code:
Private Sub PanoramaPage1_BackKeyPress(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles MyBase.BackKeyPress
MyBase.Finalize()
End Sub
for some forms i just need them to be closed/disposed and not be kept in the navigation history.
Any ideas?
Re: WP7 - OnBackKeyPress Dispose()?
Forms should be closed automatically when the back button is pressed - and objects disposed of.
Are you talking about forms here, or panorama pages?
the OnNavigatedFrom event is fired when you press a back button - any clean up would be done there
Re: WP7 - OnBackKeyPress Dispose()?
hmm yeah it's a panorama page.
Thing is, when i press the back button the panorama page doesn't seem to be disposed because if i press more then once, the program will re open all pages that i opened before
Re: WP7 - OnBackKeyPress Dispose()?
Hi,
if it is opening pages you navigated through to get to the panorama page - that is correct. The back key should always take you to the screen you came from, and the back key on the main page should exit the application.
That is how it is designed to work
Re: WP7 - OnBackKeyPress Dispose()?
My error, i wasn't using NavigationService.GoBack(), instead, i was using NavigationService.Navigate() to go back to the main xaml. Yeah you were right, the back command actually closes the pages.
Re: [RESOLVED] WP7 - OnBackKeyPress Dispose()?
btw, i can't rate your post, the link is crying about "You must spread some Reputation around before giving it to petevick again."