开发者

Silverlight Navigation - how to override Back button behavior

开发者 https://www.devze.com 2022-12-31 03:43 出处:网络
I\'m trying to override the default behavior of the browser\'s back button in Silverlight (v4). Each of my XAML pages has an ability to show options. I want these options to be hidden when the user pr

I'm trying to override the default behavior of the browser's back button in Silverlight (v4). Each of my XAML pages has an ability to show options. I want these options to be hidden when the user presses the back button, or to move to the previous page if the options are not visible. The Silverlight Frame seems to set back and forward points whenever the user navigates to a page with a new QueryString. Is there any other way of implementing my scenario other than having to开发者_StackOverflow社区 implement a querystring component for my ShowOptions property?


PhoneApplicationPage class has BackKeyPress event

BackKeyPress += MainPage_BackKeyPress;

private void MainPage_BackKeyPress(object sender, CancelEventArgs e)
    {
        e.Cancel = true;
        // do whatever you want
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消