Click here to Skip to main content
15,892,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
In my Windows Phone 7 app I have a timeline that plays and changes the content of a textbox to "ON". Basically when the textbox's content is "ON" and the user presses the hardware back button the timeline will stop playing and the user will not go back. However if the timeline is not playing and the user hits the back button I want them to go back.

here is my code so far:
C#
protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
         {
             if (txit.Text == "ON")
             {
                 txit.Text = "OFF";
                 camOUT.Stop();
             }
             else
             {
                 NavigationService.GoBack();
             }

         }


Thanks.
Posted
Comments
Mark Salsbery 3-Jun-11 23:26pm    
What is the problem? You may need a "e.Cancel = true;" in there somewhere...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900