Results 1 to 6 of 6

Thread: [RESOLVED] WP7 - OnBackKeyPress Dispose()?

  1. #1

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    Resolved [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?
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    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
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  4. #4
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    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
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  5. #5

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    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.
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

  6. #6

    Thread Starter
    Fanatic Member TDQWERTY's Avatar
    Join Date
    Oct 2003
    Location
    Oporto & Leiria, Portugal / Luanda, Angola
    Posts
    972

    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."
    ::Winamp 5.xx id3v2 & modern skin support::
    ::NetCF DataGrid Programatically Scroll Example::
    Don't forget to rate posts from those who helped you solving your problem, clicking on and rating it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width