Skip to content

Fix for TabBar Navigation does not invoke its IQueryAttributable.ApplyQueryAttributes(query)#25663

Merged
PureWeen merged 23 commits intodotnet:inflight/currentfrom
SuthiYuvaraj:fix-13573
Dec 4, 2025
Merged

Fix for TabBar Navigation does not invoke its IQueryAttributable.ApplyQueryAttributes(query)#25663
PureWeen merged 23 commits intodotnet:inflight/currentfrom
SuthiYuvaraj:fix-13573

Conversation

@SuthiYuvaraj
Copy link
Contributor

@SuthiYuvaraj SuthiYuvaraj commented Nov 4, 2024

Issue Details

While navigating between pages, ApplyQueryAttributes should trigger with data from the navigating page. In the current implementation, navigation using Push and GoToAsync works as expected, but other navigation methods do not trigger ApplyQueryAttributes notifications.

Root Cause

-GoToAsync Limitations: When navigating using PopAsync, PopModalAsync, back navigation, or between FlyoutPages, ApplyQueryAttributes is not triggered. This occurs because QueryAttributes is not correctly set for these navigation types.
-TabBar Navigation: Navigating between TabBar items changes the page by updating CurrentItemChanged. However, QueryAttributes is not updated for these item changes, leading to missing attribute notifications.

Fix Details

-GoToAsync Fix: Updated ShellNavigationManager to apply ApplyQueryAttributes when popping, ensuring QueryableAttributes values are set correctly.

-TabBar Navigation Fix: Invoked ApplyQueryAttributes within UpdateCurrentState to receive notifications for all ShellItem navigations, ensuring that QueryAttributes are updated consistently across TabBar item changes.

Issues Fixed

Fixes #13537
Fixes #28453

Output Screenshot

Before Issue Fix After Issue Fix
Before Fix video After Fix video

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Nov 4, 2024
@dotnet-policy-service
Copy link
Contributor

Hey there @SuthiYuvaraj! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@SuthiYuvaraj SuthiYuvaraj changed the title Fix 13573 Fix for Tabs does not invoke its IQueryAttributable.ApplyQueryAttributes(query) Nov 4, 2024
@jsuarezruiz jsuarezruiz added the area-controls-shell Shell Navigation, Routes, Tabs, Flyout label Nov 6, 2024
@dotnet dotnet deleted a comment from azure-pipelines bot Nov 6, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@SuthiYuvaraj SuthiYuvaraj marked this pull request as ready for review November 13, 2024 03:37
@SuthiYuvaraj SuthiYuvaraj requested a review from a team as a code owner November 13, 2024 03:37
@jsuarezruiz
Copy link
Contributor

/rebase

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

There are unit tests failing:

Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual:   True

 Failed SetCurrentItemAddsToShellCollection [1 ms]
  Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at Microsoft.Maui.Controls.Shell.Microsoft.Maui.Controls.IShellController.UpdateCurrentState(ShellNavigationSource source) in /_/src/Controls/src/Core/Shell/Shell.cs:line 936
   at Microsoft.Maui.Controls.ShellNavigationManager.GoToAsync(ShellNavigationParameters shellNavigationParameters, ShellNavigationRequest navigationRequest) in /_/src/Controls/src/Core/Shell/ShellNavigationManager.cs:line 204
   at Microsoft.Maui.Controls.Shell.<Initialize>g__SetCurrentItem|158_1() in /_/src/Controls/src/Core/Shell/Shell.cs:line 1284
   at Microsoft.Maui.Controls.Shell.<Initialize>b__158_0(Object s, NotifyCollectionChangedEventArgs e) in /_/src/Controls/src/Core/Shell/Shell.cs:line 1217
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)

@jsuarezruiz jsuarezruiz added the area-navigation NavigationPage label Nov 26, 2024
@SuthiYuvaraj
Copy link
Contributor Author

There are unit tests failing:

Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual:   True

 Failed SetCurrentItemAddsToShellCollection [1 ms]
  Error Message:
   System.NullReferenceException : Object reference not set to an instance of an object.
  Stack Trace:
     at Microsoft.Maui.Controls.Shell.Microsoft.Maui.Controls.IShellController.UpdateCurrentState(ShellNavigationSource source) in /_/src/Controls/src/Core/Shell/Shell.cs:line 936
   at Microsoft.Maui.Controls.ShellNavigationManager.GoToAsync(ShellNavigationParameters shellNavigationParameters, ShellNavigationRequest navigationRequest) in /_/src/Controls/src/Core/Shell/ShellNavigationManager.cs:line 204
   at Microsoft.Maui.Controls.Shell.<Initialize>g__SetCurrentItem|158_1() in /_/src/Controls/src/Core/Shell/Shell.cs:line 1284
   at Microsoft.Maui.Controls.Shell.<Initialize>b__158_0(Object s, NotifyCollectionChangedEventArgs e) in /_/src/Controls/src/Core/Shell/Shell.cs:line 1217
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)

Hi @jsuarezruiz , The UpdateCurrentState method has been updated with proper null handling. Kindly review it and let us know if you any concerns.

@jsuarezruiz
Copy link
Contributor

jsuarezruiz commented Nov 27, 2024

/azp run

@azure-pipelines

This comment was marked as outdated.

Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

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

Sorry, still there is one failing unit tests:

Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual:   True

@SuthiYuvaraj
Copy link
Contributor Author

Sorry, still there is one failing unit tests:

Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual:   True

@jsuarezruiz, The failing unit test case is intended to verify that the query attribute should not be present during the initial loading. However, the bug report confirms this behavior as a valid bug #13537 (comment), the test case is no longer applicable. Can the failing test case be removed?

@sheiksyedm sheiksyedm added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Dec 6, 2024
@SuthiYuvaraj
Copy link
Contributor Author

Sorry, still there is one failing unit tests:

Failed InitialNavigationDoesntSetQueryAttributesProperty [< 1 ms]
Error Message:
Assert.False() Failure
Expected: False
Actual:   True

@jsuarezruiz , After analyzing the failed test case (InitialNavigationDoesntSetQueryAttributesProperty) scenario, I have modified the fix to prevent invoking the QueryableAttribute during the initial loading. Kindly review it and share any concerns

@azure-pipelines

This comment was marked as outdated.

@SuthiYuvaraj SuthiYuvaraj changed the title Fix for Tabs does not invoke its IQueryAttributable.ApplyQueryAttributes(query) Fix for TabBar Navigation does not invoke its IQueryAttributable.ApplyQueryAttributes(query) Dec 18, 2024
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen PureWeen added this to the .NET 9 SR12 milestone Aug 4, 2025
@PureWeen PureWeen modified the milestones: .NET 9 SR12, .NET 10 SR1 Sep 10, 2025
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@StephaneDelcroix
Copy link
Contributor

when merged, merge additional tests from #33006

@github-project-automation github-project-automation bot moved this from In Progress to Approved in MAUI SDK Ongoing Dec 4, 2025
@PureWeen PureWeen changed the base branch from main to inflight/current December 4, 2025 16:06
@PureWeen PureWeen merged commit f6a7b5c into dotnet:inflight/current Dec 4, 2025
120 of 217 checks passed
@github-project-automation github-project-automation bot moved this from Approved to Done in MAUI SDK Ongoing Dec 4, 2025
github-actions bot pushed a commit that referenced this pull request Dec 5, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
PureWeen pushed a commit that referenced this pull request Dec 8, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
PureWeen pushed a commit that referenced this pull request Dec 10, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
PureWeen pushed a commit that referenced this pull request Dec 16, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
github-actions bot pushed a commit that referenced this pull request Dec 22, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
PureWeen pushed a commit that referenced this pull request Dec 22, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
github-actions bot pushed a commit that referenced this pull request Dec 24, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
PureWeen pushed a commit that referenced this pull request Dec 26, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
github-actions bot pushed a commit that referenced this pull request Dec 27, 2025
…yQueryAttributes(query) (#25663)

* Fix - 13573 fix changes

* Testcases commit

* Update Shell.cs

* commit for testcases

* commit for review changes

* Commit for class name changes

* Commit class name change

* Commit for review

* commit for testcase changes

* Commit for images

* Test case changes

* Update Issue13537.cs

* Update Issue13537.cs

* Update Issue13537.cs

* Update Shell.cs

* Update Shell.cs

* changes for initial triggering

* comments updated

* Update Issue13537.cs

* Update Issue13537.cs

commit testcase failure

* Changes for indentation

* Review changes

* Update Issue13537.cs
PureWeen added a commit that referenced this pull request Dec 29, 2025
## CollectionView
- Fixed the NRE in CarouselViewController on iOS 15.5 & 16.4 by
@Ahamed-Ali in #30838
  <details>
  <summary>🔧 Fixes</summary>

- [NRE in CarouselViewController on iOS 15.5 &
16.4](#28557)
  </details>

- [iOS, macOS] Fixed CollectionView group header size changes with
ItemSizingStrategy by @NanthiniMahalingam in
#33161
  <details>
  <summary>🔧 Fixes</summary>

- [[NET 10] I6_Grouping - Grouping_with_variable_sized_items changing
the 'ItemSizingStrategy' also changes the header
size.](#33130)
  </details>

## Flyout
- Add unit tests for TabBar and FlyoutItem navigation
ApplyQueryAttributes (#25663) by @StephaneDelcroix in
#33006

## Flyoutpage
- Fixed the FlyoutPage.Flyout Disappearing When Maximizing the Window on
Mac Platform by @NanthiniMahalingam in
#26701
  <details>
  <summary>🔧 Fixes</summary>

- [FlyoutPage.Flyout - navigation corrupted when running om mac , on
window ok](#22719)
  </details>

## Mediapicker
- [Windows] Fix for PickPhotosAsync throws exception if image is
modified by @HarishwaranVijayakumar in
#32952
  <details>
  <summary>🔧 Fixes</summary>

- [PickPhotosAsync throws exception if image is
modified.](#32408)
  </details>

## Navigation
- Fix for TabBar Navigation does not invoke its
IQueryAttributable.ApplyQueryAttributes(query) by @SuthiYuvaraj in
#25663
  <details>
  <summary>🔧 Fixes</summary>

- [Tabs defined in AppShell.xaml does not invoke its view model's
IQueryAttributable.ApplyQueryAttributes(query)
implementaion](#13537)
- [`ShellContent` routes do not call
`ApplyQueryAttributes`](#28453)
  </details>

## ScrollView
- Fix ScrollToPosition.Center behavior in ScrollView on iOS and
MacCatalyst by @devanathan-vaithiyanathan in
#26825
  <details>
  <summary>🔧 Fixes</summary>

- [ScrollToPosition.Center Centers the First Item too in iOS and
Catalyst](#26760)
- [On iOS - ScrollView.ScrollToAsync Element,
ScrollToPosition.MakeVisible shifts view to the right, instead of just
scrolling vertically](#28965)
  </details>

## Searchbar
- [iOS, Mac, Windows] Fixed CharacterSpacing for SearchBar text and
placeholder text by @Dhivya-SF4094 in
#30407
  <details>
  <summary>🔧 Fixes</summary>

- [[iOS, Mac, Windows] SearchBar CharacterSpacing property is not
working as expected](#30366)
  </details>

## Shell
- Update logic for large title display mode on iOS - shell by @kubaflo
in #33039

## TitleView
- [iOS] Fixed memory leak with PopToRootAsync when using TitleView by
@Vignesh-SF3580 in #28547
  <details>
  <summary>🔧 Fixes</summary>

- [NavigationPage.TitleView causes memory leak with
PopToRootAsync](#28201)
  </details>

## Xaml
- [C] Fix binding to interface-inherited properties like
IReadOnlyList<T>.Count by @StephaneDelcroix in
#32912
  <details>
  <summary>🔧 Fixes</summary>

- [Compiled Binding to Array.Count provides no
result](#13872)
  </details>

- Fix #31939: CommandParameter TemplateBinding lost during reparenting
by @StephaneDelcroix in #32961
  <details>
  <summary>🔧 Fixes</summary>

- [CommandParameter TemplateBinding Lost During ControlTemplate
Reparenting](#31939)
  </details>


<details>
<summary>🧪 Testing (4)</summary>

- [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate
by @TamilarasanSF4853 in #33257
- [Testing] Re-saved ShouldFlyoutBeVisibleAfterMaximizingWindow test
case images in PR 33185 - [12/22/2025] Candidate by @TamilarasanSF4853
in #33271
- [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate
- 2 by @TamilarasanSF4853 in #33299
- [Testing] Fixed Test case failure in PR 33185 - [12/22/2025] Candidate
- 3 by @TamilarasanSF4853 in #33311

</details>

<details>
<summary>📦 Other (2)</summary>

- [XSG][BindingSourceGen] Add support for RelayCommand to compiled
bindings by @simonrozsival via @Copilot in
#32954
  <details>
  <summary>🔧 Fixes</summary>

  - [Issue #25818](#25818)
  </details>
- Revert "Update logic for large title display mode on iOS - shell
(#33039)" in cff7f35

</details>
**Full Changelog**:
main...inflight/candidate
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-controls-shell Shell Navigation, Routes, Tabs, Flyout area-navigation NavigationPage community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration

Projects

Status: Done

6 participants