B. Kemmer
B. Kemmer

Reputation: 1537

Frame.GoBack minimizes the Application

public Constructor1()
{
    this.NavigationCacheMode = NavigationCacheMode.Enabled;
}

....

public Constructor2()
{
    this.NavigationCacheMode = NavigationCacheMode.Enabled;
    HardwareButtons.BackPressed += this.MainPage_BackPressed;
}

private void MainPage_BackPressed(object sender, BackPressedEventArgs e)
{
    if(this.Frame.CanGoBack)
    {
        this.Frame.GoBack();
    }
}

After I use the BackButton on my Windows Phone my Application minimizes itself. I have to go to the Task Manager and click on it to bring it back up. Any suggestions why Frame.GoBack minimizes the Application?

Upvotes: 0

Views: 370

Answers (1)

B. Kemmer
B. Kemmer

Reputation: 1537

private void MainPage_BackPressed(object sender, BackPressedEventArgs e)
{
    if(this.Frame.CanGoBack)
    {
        e.Handled = true;
        this.Frame.GoBack();
    }
}

e.Handled = true; was the problem.

Upvotes: 2

Related Questions