[Q] who to moderate back key press in WP8.1

Search This thread

ngame

Senior Member
Mar 13, 2012
1,126
554
Mashad
Hi every one
In WP8 we could use
Protected Override Void OnbackKeyPress(....e)
{
}
Now I didn't find such thing in windows Phone 8.1 ! Can anyone help me with this ?
and my other Q is : where is the messagebox.show ? and also Isolated Storage ?! :D :D
Now I think get an absolutely Noooob again :D
 

ElStoney

New member
Apr 17, 2014
1
1
Hi every one
In WP8 we could use
Protected Override Void OnbackKeyPress(....e)
{
}
Now I didn't find such thing in windows Phone 8.1 ! Can anyone help me with this ?
and my other Q is : where is the messagebox.show ? and also Isolated Storage ?! :D :D
Now I think get an absolutely Noooob again :D

Hi,

instead of overriding OnbackKeyPress you have to register the event
...
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
...

void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
// your code
e.Handled = true; // if you wanna prevent that the "standard"-eventhandler is called and your app getting closed
}

Best,
 
  • Like
Reactions: ngame

ngame

Senior Member
Mar 13, 2012
1,126
554
Mashad
Hi,

instead of overriding OnbackKeyPress you have to register the event
...
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
...

void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
// your code
e.Handled = true; // if you wanna prevent that the "standard"-eventhandler is called and your app getting closed
}

Best,
Thanks.
And what about isolated storage?
I can't use them any more and power tools ran out
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Hi every one
    In WP8 we could use
    Protected Override Void OnbackKeyPress(....e)
    {
    }
    Now I didn't find such thing in windows Phone 8.1 ! Can anyone help me with this ?
    and my other Q is : where is the messagebox.show ? and also Isolated Storage ?! :D :D
    Now I think get an absolutely Noooob again :D

    Hi,

    instead of overriding OnbackKeyPress you have to register the event
    ...
    Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
    ...

    void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
    {
    // your code
    e.Handled = true; // if you wanna prevent that the "standard"-eventhandler is called and your app getting closed
    }

    Best,
    1
    Look for StorageFile and StorageFolder:
    http://msdn.microsoft.com/de-de/library/windows/apps/windows.storage.aspx

    And here is a Storage Helper class from Jerry Nixon that is useful: http://codepaste.net/gtu5mq