Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigationView doesn't respond if NavigationCacheMode is Enabled #1488

Closed
AlKau opened this issue Feb 18, 2019 · 2 comments
Closed

NavigationView doesn't respond if NavigationCacheMode is Enabled #1488

AlKau opened this issue Feb 18, 2019 · 2 comments
Assignees

Comments

@AlKau
Copy link

AlKau commented Feb 18, 2019

SDK target 17763; min 17134;
PC: Win10 1809

Code Sample:
XAML:

<Page x:Class="NavigationViewBug.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="using:NavigationViewBug"
      xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      mc:Ignorable="d"
      NavigationCacheMode="Enabled"
      Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <muxc:NavigationView ItemInvoked="OnItemInvoked">
            <muxc:NavigationView.MenuItems>
                <muxc:NavigationViewItem Content="Page #1"
                                         Icon="Page"
                                         Tag="Page #1" />
                <muxc:NavigationViewItem Content="Page #2"
                                         Icon="Page2"
                                         Tag="Page #2" />
                <muxc:NavigationViewItem Content="Pane #3"
                                         Icon="Cancel"
                                         Tag="Page #3" />
            </muxc:NavigationView.MenuItems>

            <Frame x:Name="FrameContent"/>

        </muxc:NavigationView>
    </Grid>
</Page>

C#:

private void OnItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
{
    switch (args.InvokedItemContainer.Tag)
    {
        case "Page #1":
            FrameContent.Navigate(typeof(Page1));
            break;
        case "Page #2":
            FrameContent.Navigate(typeof(Page2));
            break;
        default:
            Frame.Navigate(typeof(Page3));
            break;
    }
}

When Page3 calls "Frame.GoBack();", MainPage is loaded and NavigationView doesn't respond.

        private void OnBackRequested(object sender, BackRequestedEventArgs e)
        {
            if (Frame.CanGoBack)
            {
                Frame.GoBack();
                e.Handled = true;
            }
        }

I can't reproduce it on PC: Win10 1803 or NavigationCacheMode="Disabled"
full project: https://github.com/AlKau/UWP-Samples/tree/master/NavigationViewBug


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@YuliKl YuliKl self-assigned this Feb 22, 2019
@YuliKl
Copy link
Contributor

YuliKl commented Feb 22, 2019

@AlKau - I'm sorry to hear you're encountering this problem. As this is an issue in code and not in documentation, can you please re-open this issue in the microsoft-ui-xaml GitHub repo using the bug template? This will give our engineers an opportunity to dig into and debug the problem.

@AlKau
Copy link
Author

AlKau commented Feb 25, 2019

It seems, it's been fixed (microsoft/microsoft-ui-xaml#18).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants