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

make navviewitem clickable after navview is freely moved between visualtrees. #249

Merged
merged 1 commit into from
Jan 31, 2019

Conversation

licanhua
Copy link
Contributor

@licanhua licanhua commented Jan 31, 2019

Fixes #18
This resolved two kinds of problem:

  1. NavViewItem is not clickable after navview is moved to another place in the visualtree. for example, between two frames. see issue 18
  2. NavViewItem is not clickable if Page.NavigationCacheMode="Enabled" and it's navigating back. see navigationcachemode breaks

The root cause is because that unloaded and loaded event are not paired. When navview is unloaded, we revoked all the event token, but we didn't observe it again when navview is loaded again. After it's moved or page restored from cache, navviewitem doesn't raise click event anymore.

To keep the solution simple, I just hook/unhook titlebar events on unloaded/loaded event. we expect this because titlebar is in global space and it exists even if NavView is inactive or is destroyed.

@licanhua licanhua requested a review from a team January 31, 2019 00:03
@licanhua licanhua merged commit 92b6292 into master Jan 31, 2019
@licanhua licanhua deleted the user/canli/navunloadedissue branch February 1, 2019 20:43
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.1.190131001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

@fargate
Copy link

fargate commented Feb 6, 2019

Issue 2. NavViewItem is not clickable if Page.NavigationCacheMode="Enabled" and it's navigating back. is still not fixed.
With NuGet package 2.1.190131001-prerelease installed the NavViewItem is still not clickable after navigating back as can be seen in the screenshot below.

image

@licanhua
Copy link
Contributor Author

licanhua commented Feb 6, 2019

Thank you reporting this. I'm investigating

@licanhua
Copy link
Contributor Author

licanhua commented Feb 6, 2019

@jevansaks Is there something wrong? the bot said: Microsoft.UI.Xaml v2.1.190131001-prerelease has been released which incorporates this pull request.
but actually the pull request is not in https://github.com/Microsoft/microsoft-ui-xaml/blob/release/1901/nuget-2019-01-31/dev/NavigationView/NavigationView.cpp

@fargate the code is not in offical nuget yet.

@jevansaks
Copy link
Member

jevansaks commented Feb 6, 2019 via email

@fargate
Copy link

fargate commented Feb 7, 2019

Thanks for investigating. Any idea when this will be released? we have customers wanting to move to Windows 1809.

@jevansaks
Copy link
Member

We hope to do another prerelease next week. But if you can, please try the nupkg from the latest CI build (it's in the root of the artifacts drop on the build link) and make sure it's fixed there?

@fargate
Copy link

fargate commented Feb 8, 2019 via email

@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.1.190219001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

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

Successfully merging this pull request may close these issues.

Navigation fails/ refuses to work if removed and re-added from SpliView.Pane
4 participants