WP7 - Are transition animations allowed while navigating back (user press back button) from a page?
As per the certification requirements:
Pressing the Back button must return the application to the previous page.
But to go back to the previous page i will have to cancel the navigation first to do the transition animation. Can such an app pass certification? Because i fear that if the app is statically c开发者_开发知识库hecked then it might fail if it finds e.Cancel = true in OnBackKeyPress.
Yes it will pass the certification.
My app passed the certification, and i handle the back button to make custom animations between pages.
I use e.cancel in the back button handler, start my transition, and call goback() in the transition finished event.
The new silverlight toolkit release has some nice animations you can add using xaml only, without handling the back button, but i haven't tried it out yet.
Yes apps are statically checked and yes it will pass the cert with this line of code. I have it in my code.
For example a game can show some popup (options, pause etc.) and it should be closed by the back button.
//navigate to the start page
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
{
if (m_stateOfGame == GameState.end)
{
base.OnBackKeyPress(e);
return;
}
e.Cancel = true;
if (m_popUpOpen)
{
this.ClosePopup();
this.GameStateUpdate();
m_stateOfGame = GameState.resume;
m_popUpOpen = false;
}
else
{
m_stateOfGame = GameState.pause;
this.GameStateUpdate();
ShowPopup();
m_popUpOpen = true;
}
}
A rule of thumb says that the transition animation should take ~400ms and the maxium is 1000ms.
精彩评论