When does a PhoneApplicationPage get disposed?

Viewed 1004

For example, if I have a page like this:

public partial class Page1 : PhoneApplicationPage
{
    DispatcherTimer timer = new DispatcherTimer();

    public Page1()
    {
        InitializeComponent();

        timer.Interval = TimeSpan.FromSeconds(5);
        timer.Tick += new EventHandler(timer_Tick);
        timer.Start();
    }

    void timer_Tick(object sender, EventArgs e)
    {
         MessageBox.Show("timer tick"); 
    }
}

In the app, I navigate to this page, it will pop up a message box every 5 seconds. Then I press the "Back" button on the phone and navigate back to the previous page. But the weird thing is that it still pops up a message box every 5 seconds. I know I can stop the timer in the OnNavigatedFrom method, but why is this happening? Isn't a page disposed after you press the back button on it?

Thanks

2 Answers
Related