How do I clear navigation history in Silverlight/Windows Phone 7?

前端 未结 5 1447
無奈伤痛
無奈伤痛 2021-02-10 08:18

I\'m making a Windows Phone 7 app that has login/logout semantics (authenticating to a web app). When the user logs out I navigate back to the login screen and forget the sessio

5条回答
  •  清歌不尽
    2021-02-10 09:21

    You should create "Loaded" event for your page

        private void LayoutRoot_Loaded(object sender, RoutedEventArgs e)
        {
            try { while (NavigationService.RemoveBackEntry() != null) ; }
            catch (System.NullReferenceException ex) { }
        }
    

提交回复
热议问题