none
[UWP]Why appear two back button? RRS feed

Answers

  • Hi Nguyen_Thanh_Liem,

    Please locate to the "ActivationService.cs" in services folder and find the "Frame_Navigated" handler method. You could comment the code in it.

    private void Frame_Navigated(object sender, NavigationEventArgs e)
            {
                //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = NavigationService.CanGoBack ?
                //    AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
            }

    Best Regards,

    Xavier


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, June 19, 2018 3:12 AM
    Moderator

All replies

  • Hi Nguyen_Thanh_Liem,

    The display of back button on the title bar is due to the AppViewBackButtonVisibility is set to visible somewhere in your code.

    Please check the section “System back behavior for backward compatibilities” on the Navigation basics document.

    Previously, UWP apps used AppViewBackButtonVisibility for backwards navigation. The API will continue to be supported for backward compatibility, but we no longer recommend relying on the title bar back button. Instead, your app should draw its own in-app back button.

    So, you could hide/disable the back button on the title bar.

    Best Regards,

    Xavier Xie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, June 18, 2018 1:58 AM
    Moderator
  • Thank you for your reply!

    I only use Window Template Studio to create app, I don't create my own Back Button. 

    How to disable Title back button?

    Thank!


    Monday, June 18, 2018 7:53 AM
  • Hi Nguyen_Thanh_Liem,

    Please locate to the "ActivationService.cs" in services folder and find the "Frame_Navigated" handler method. You could comment the code in it.

    private void Frame_Navigated(object sender, NavigationEventArgs e)
            {
                //SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = NavigationService.CanGoBack ?
                //    AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
            }

    Best Regards,

    Xavier


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, June 19, 2018 3:12 AM
    Moderator
  • Thank for help me turn off title back button.

    Can you tell me how to turn off the second back button in image above!

    Thank you!

    Tuesday, June 19, 2018 1:56 PM
  • Thank for help me turn off title back button.

    Can you tell me how to turn off the second back button in image above!

    Thank you!

    It's NavigationView control's back button. It's collapsed by default when you create a Window Template Studio project. 

    Please locate to "ShellPage.xaml.cs", see "HideNavViewBackButton" method.

    private void HideNavViewBackButton()
            {
                if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 6))
                {
                    navigationView.IsBackButtonVisible = NavigationViewBackButtonVisible.Collapsed;
                }
            }

    You might have changed the value of the "IsBackButtonVisible" somewhere in your code. You could find all "navigationView.IsBackButtonVisible" and reset it.

    In addition, please do not mark my correct reply and then unmark it for letting me answer your new question. It's not a good "mark" behavior. If you have a new question, you'd better post a new thread on the forum. It's my pleasure to help you. Thanks for your understanding.

    Best Regards,

    Xavier Xie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    Wednesday, June 20, 2018 2:26 AM
    Moderator
  • Sorry my bad!

    Thank you for your help!

    Thursday, June 21, 2018 2:57 PM
  • Sorry my bad!

    Thank you for your help!

    It's Ok. It's my pleasure to help you.

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 22, 2018 1:28 AM
    Moderator