0
votes

I have a MasterDetail page. The Detail is a NavigationPage. In the NavigationPage I put a ContentPage. So the hierarchy is:

MasterDetail
  - Master
  - Detail
    - NavigationPage
      - ContentPage

The navigation bar in my NavigationPage has an ActivityIndicator in it. The IsRunning property of the ActivityIndicator is bound to the IsRunning property of my ContentPage's view model. So when I load the ContentPage I see a spinning ActivityIndicator in the navigation bar. This works fine.

When I navigate to a new page, I call PushAsync on the NavigationPage to push a new ContentPage on the stack. The new page I push also has a view model with an IsRunning property. The problem is that the binding in the navigation bar is now broken and never shows the ActivityIndicator as running even if I set IsRunning to true.

So it feels like the binding gets broken on navigation. Any ideas on the root cause or how to fix this? Thanks in advance!

1
could update your post with the code you have implemented and that it’s not working correctly ?pinedax
I agree with @apineda, code will help. However, based on the description, it sounds like the BindingContext is not being set when navigating to the second page.Tom
Thank you both for helping me solve the issue. In creating some sample code to share, I realized that I wasn't calling SetTitleView when the new ContentPage was loaded so my custom nav bar with ActivityIndicator wasn't being loaded. Since my custom bar looks identical otherwise, I couldn't tell that it wasn't my custom one I was seeing. Thanks again!NorthFork

1 Answers

0
votes

Mistake on my end, I wasn't calling SetTitleView when the new ContentPage was loaded. Turned out it wasn't a binding issue.