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

Prevent NavigationPage & TabbedPage from inheriting parents BindingContext #2590

Merged
merged 1 commit into from
Oct 15, 2021

Conversation

brianlagunas
Copy link
Member

Description of Change

By default, elements in a XF app will always inheit their parent's BindingContext. This becomes an issue when using a FlyoutPage and a TabbedPage and then using a NavigationPage as a child. The NavigationPage will inherit the parents BindingContext which would then invoke the Prism navigation interfaces when they shouldn't be invoked.

We fix this by preventing the NavigationPage and TabbedPage from inheriting their parent's BindingContext.

Bugs Fixed

API Changes

None

Behavioral Changes

The NavigationPage and TabbedPage types will no longer inherit their Parent's BindingContext. If you would like for these types to have a iffeent BindingContext, you will have to register a ViewModel with the Prism NavigatinService.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard

Copy link
Member

@dansiegel dansiegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for publishing a PR with the code I sent you 😆

@brianlagunas
Copy link
Member Author

So that's your definition of paired programming... okay... I'll remember that

@brianlagunas brianlagunas merged commit ac99099 into master Oct 15, 2021
@brianlagunas brianlagunas deleted the issue-2587 branch October 15, 2021 18:47
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.

2 participants