Skip to content

[Windows] Shell: Apply TabBarDisabledColor to disabled tabs - #35885

Merged
kubaflo merged 5 commits into
dotnet:inflight/currentfrom
Dhivya-SF4094:fix-34738
Oct 13, 2026
Merged

kubaflo merged 5 commits into
dotnet:inflight/currentfrom
Dhivya-SF4094:fix-34738

Conversation

@Dhivya-SF4094

Copy link
Copy Markdown
Contributor

Note

Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!

Issue Details:

  • When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor property is expected to change the icon and text color of the disabled Tab. On windows the TabBarDisabledColor is not applied, and the TabBar continues to use the default system disabled color.

  • Additionally, on the initial load, only the tab text appeared disabled while the tab icon continued to display with the enabled color until a later update.

Root Cause:

Missing TabBarDisabledColor application

  • UpdateAppearance() never propagated EffectiveTabBarDisabledColor to the native WinUI controls, so the configured TabBarDisabledColor was ignored and the default system disabled color was used instead.

Incorrect initial disabled icon color

  • During SetValues(), IsEnabled was assigned before the disabled foreground brush. As a result, UpdateForeground()executed before DisabledForeground was available, causing the icon to use the default foreground.
  • In addition, WinUI applies its Disabled visual state immediately when IsEnabled changes, which could override the custom icon foreground during the initial load.

Description of change:

  • Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled text color through the WinUI TopNavigationViewItemForegroundDisabled theme resource and propagate the disabled foreground brush to existing NavigationViewItemViewModel instances.
  • Added a DisabledForeground property to NavigationViewItemViewModel and updated the foreground logic to use it whenever the item is disabled.
  • Updated the icon setter to reapply the foreground after the icon element is created, ensuring the custom disabled color overrides WinUI's initial visual-state transition.
  • Updated ShellItemHandler.Windows so UpdateAppearance() applies the disabled color, and reordered SetValues() to assign DisabledForeground before IsEnabled, ensuring the correct brush is available when the disabled state is applied.

Validated the behavior in the following platforms

  • Android
  • Windows
  • iOS
  • Mac

Fixes

Fixes #34738

Screenshots

Before  After
     

@github-actions

github-actions Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 35885

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 35885"

@github-actions github-actions Bot added area-controls-shell Shell Navigation, Routes, Tabs, Flyout platform/windows labels Jun 12, 2026
@kubaflo

kubaflo commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

/review -b feature/enhanced-reviewer

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jun 12, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 1 findings

See inline comments for details.

@MauiBot MauiBot added the s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review) label Jun 12, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jun 12, 2026
@Dhivya-SF4094 Dhivya-SF4094 changed the title [WIP] Fix TabBarDisabledColor is not applied when the TabBar is in a disabled state [Windows] [Windows]Fix TabBarDisabledColor is not applied when the TabBar is in a disabled state Jun 16, 2026
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 5, 2026
@MauiBot MauiBot added s/agent-gate-failed AI could not verify tests catch the bug s/agent-fix-win AI found a better alternative fix than the PR labels Jul 5, 2026
MauiBot

This comment was marked as outdated.

@MauiBot MauiBot removed the s/agent-review-in-progress AI review is currently running for this PR label Jul 5, 2026

@kubaflo kubaflo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you please check the ai's suggestions?

@Dhivya-SF4094 Dhivya-SF4094 changed the title [Windows]Fix TabBarDisabledColor is not applied when the TabBar is in a disabled state [Windows] Shell: Apply TabBarDisabledColor to disabled tabs Jul 8, 2026
@kubaflo

This comment has been minimized.

@github-actions github-actions Bot added the s/agent-review-in-progress AI review is currently running for this PR label Jul 9, 2026

@MauiBot MauiBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Expert Review — 2 findings

See inline comments for details.

@MauiBot MauiBot added s/agent-fix-pr-picked AI could not beat the PR fix - PR is the best among all candidates and removed s/agent-fix-win AI found a better alternative fix than the PR labels Jul 9, 2026
MauiBot

This comment was marked as outdated.

@kubaflo

kubaflo commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

@Dhivya-SF4094, is this PR ready for review? If it still needs work, please keep it as a draft; otherwise, please mark it ready for review.

@Dhivya-SF4094

Copy link
Copy Markdown
Contributor Author

#35885 (review)

Reviewed the AI summary, investigated the concerns, and addressed the valid ones.

@vishnumenon2684

Copy link
Copy Markdown
Contributor

/azp run maui-pr-uitests , maui-pr-devicetests

@vishnumenon2684 vishnumenon2684 added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Oct 13, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Nested-item coverage is missing, and the PR description inaccurately describes the implemented ordering.

2 open findings
What changed in this PR

Applies Shell TabBarDisabledColor to disabled Windows tab icons and text, including dynamically added tabs.

Changes:

  • Adds disabled foreground handling to Windows navigation items.
  • Reapplies Shell appearance after menu synchronization.
  • Enables Windows UI coverage and adds a device test.
File Description
NavigationViewItemViewModel.cs Tracks and applies disabled foregrounds.
NavigationViewExtensions.cs Propagates disabled colors and WinUI resources.
Issue32995.cs (UI test) Enables Windows screenshot validation.
Issue32995.cs (HostApp) Contains whitespace-only formatting changes.
ShellTabBarTests.Windows.cs Tests dynamically added disabled tabs.
ShellItemHandler.Windows.cs Applies disabled appearance after item mapping.

🧠 Review effort: Balanced

Comment on lines +293 to +295
if (_shellAppearanceElement is not null)
{
UpdateAppearance(_shellAppearanceElement);
Comment on lines +164 to +168
if (item.MenuItemsSource is { } subItems)
{
foreach (var subItem in subItems)
{
subItem.DisabledForeground = brush;
@kubaflo
kubaflo changed the base branch from main to inflight/current October 13, 2026 14:00
@kubaflo
kubaflo merged commit 3a8ea1d into dotnet:inflight/current Oct 13, 2026
186 of 211 checks passed
@github-actions github-actions Bot added this to the .NET 10 SR12 milestone Oct 13, 2026
kubaflo pushed a commit that referenced this pull request Oct 14, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

- When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor
property is expected to change the icon and text color of the disabled
Tab. On windows the TabBarDisabledColor is not applied, and the TabBar
continues to use the default system disabled color.

- Additionally, on the initial load, only the tab text appeared disabled
while the tab icon continued to display with the enabled color until a
later update.


### Root Cause:
**Missing TabBarDisabledColor application**

- UpdateAppearance() never propagated EffectiveTabBarDisabledColor to
the native WinUI controls, so the configured TabBarDisabledColor was
ignored and the default system disabled color was used instead.

**Incorrect initial disabled icon color**

- During SetValues(), IsEnabled was assigned before the disabled
foreground brush. As a result, UpdateForeground()executed before
DisabledForeground was available, causing the icon to use the default
foreground.
- In addition, WinUI applies its Disabled visual state immediately when
IsEnabled changes, which could override the custom icon foreground
during the initial load.

### Description of change:

- Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled
text color through the WinUI TopNavigationViewItemForegroundDisabled
theme resource and propagate the disabled foreground brush to existing
NavigationViewItemViewModel instances.
- Added a DisabledForeground property to NavigationViewItemViewModel and
updated the foreground logic to use it whenever the item is disabled.
- Updated the icon setter to reapply the foreground after the icon
element is created, ensuring the custom disabled color overrides WinUI's
initial visual-state transition.
- Updated ShellItemHandler.Windows so UpdateAppearance() applies the
disabled color, and reordered SetValues() to assign DisabledForeground
before IsEnabled, ensuring the correct brush is available when the
disabled state is applied.


### Validated the behavior in the following platforms
- [ ] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Fixes
Fixes #34738 

### Screenshots
| Before  | After |
|---------|--------|
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/c8980378-7f4c-414d-ba68-d1760f24c8f6">
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/9a5a6a5f-2301-4d75-95f8-27306c97072e"> 
|
kubaflo pushed a commit that referenced this pull request Oct 18, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

- When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor
property is expected to change the icon and text color of the disabled
Tab. On windows the TabBarDisabledColor is not applied, and the TabBar
continues to use the default system disabled color.

- Additionally, on the initial load, only the tab text appeared disabled
while the tab icon continued to display with the enabled color until a
later update.


### Root Cause:
**Missing TabBarDisabledColor application**

- UpdateAppearance() never propagated EffectiveTabBarDisabledColor to
the native WinUI controls, so the configured TabBarDisabledColor was
ignored and the default system disabled color was used instead.

**Incorrect initial disabled icon color**

- During SetValues(), IsEnabled was assigned before the disabled
foreground brush. As a result, UpdateForeground()executed before
DisabledForeground was available, causing the icon to use the default
foreground.
- In addition, WinUI applies its Disabled visual state immediately when
IsEnabled changes, which could override the custom icon foreground
during the initial load.

### Description of change:

- Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled
text color through the WinUI TopNavigationViewItemForegroundDisabled
theme resource and propagate the disabled foreground brush to existing
NavigationViewItemViewModel instances.
- Added a DisabledForeground property to NavigationViewItemViewModel and
updated the foreground logic to use it whenever the item is disabled.
- Updated the icon setter to reapply the foreground after the icon
element is created, ensuring the custom disabled color overrides WinUI's
initial visual-state transition.
- Updated ShellItemHandler.Windows so UpdateAppearance() applies the
disabled color, and reordered SetValues() to assign DisabledForeground
before IsEnabled, ensuring the correct brush is available when the
disabled state is applied.


### Validated the behavior in the following platforms
- [ ] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Fixes
Fixes #34738 

### Screenshots
| Before  | After |
|---------|--------|
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/c8980378-7f4c-414d-ba68-d1760f24c8f6">
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/9a5a6a5f-2301-4d75-95f8-27306c97072e"> 
|
kubaflo pushed a commit that referenced this pull request Oct 21, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

- When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor
property is expected to change the icon and text color of the disabled
Tab. On windows the TabBarDisabledColor is not applied, and the TabBar
continues to use the default system disabled color.

- Additionally, on the initial load, only the tab text appeared disabled
while the tab icon continued to display with the enabled color until a
later update.


### Root Cause:
**Missing TabBarDisabledColor application**

- UpdateAppearance() never propagated EffectiveTabBarDisabledColor to
the native WinUI controls, so the configured TabBarDisabledColor was
ignored and the default system disabled color was used instead.

**Incorrect initial disabled icon color**

- During SetValues(), IsEnabled was assigned before the disabled
foreground brush. As a result, UpdateForeground()executed before
DisabledForeground was available, causing the icon to use the default
foreground.
- In addition, WinUI applies its Disabled visual state immediately when
IsEnabled changes, which could override the custom icon foreground
during the initial load.

### Description of change:

- Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled
text color through the WinUI TopNavigationViewItemForegroundDisabled
theme resource and propagate the disabled foreground brush to existing
NavigationViewItemViewModel instances.
- Added a DisabledForeground property to NavigationViewItemViewModel and
updated the foreground logic to use it whenever the item is disabled.
- Updated the icon setter to reapply the foreground after the icon
element is created, ensuring the custom disabled color overrides WinUI's
initial visual-state transition.
- Updated ShellItemHandler.Windows so UpdateAppearance() applies the
disabled color, and reordered SetValues() to assign DisabledForeground
before IsEnabled, ensuring the correct brush is available when the
disabled state is applied.


### Validated the behavior in the following platforms
- [ ] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Fixes
Fixes #34738 

### Screenshots
| Before  | After |
|---------|--------|
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/c8980378-7f4c-414d-ba68-d1760f24c8f6">
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/9a5a6a5f-2301-4d75-95f8-27306c97072e"> 
|
kubaflo pushed a commit that referenced this pull request Oct 25, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

- When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor
property is expected to change the icon and text color of the disabled
Tab. On windows the TabBarDisabledColor is not applied, and the TabBar
continues to use the default system disabled color.

- Additionally, on the initial load, only the tab text appeared disabled
while the tab icon continued to display with the enabled color until a
later update.


### Root Cause:
**Missing TabBarDisabledColor application**

- UpdateAppearance() never propagated EffectiveTabBarDisabledColor to
the native WinUI controls, so the configured TabBarDisabledColor was
ignored and the default system disabled color was used instead.

**Incorrect initial disabled icon color**

- During SetValues(), IsEnabled was assigned before the disabled
foreground brush. As a result, UpdateForeground()executed before
DisabledForeground was available, causing the icon to use the default
foreground.
- In addition, WinUI applies its Disabled visual state immediately when
IsEnabled changes, which could override the custom icon foreground
during the initial load.

### Description of change:

- Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled
text color through the WinUI TopNavigationViewItemForegroundDisabled
theme resource and propagate the disabled foreground brush to existing
NavigationViewItemViewModel instances.
- Added a DisabledForeground property to NavigationViewItemViewModel and
updated the foreground logic to use it whenever the item is disabled.
- Updated the icon setter to reapply the foreground after the icon
element is created, ensuring the custom disabled color overrides WinUI's
initial visual-state transition.
- Updated ShellItemHandler.Windows so UpdateAppearance() applies the
disabled color, and reordered SetValues() to assign DisabledForeground
before IsEnabled, ensuring the correct brush is available when the
disabled state is applied.


### Validated the behavior in the following platforms
- [ ] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Fixes
Fixes #34738 

### Screenshots
| Before  | After |
|---------|--------|
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/c8980378-7f4c-414d-ba68-d1760f24c8f6">
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/9a5a6a5f-2301-4d75-95f8-27306c97072e"> 
|
kubaflo pushed a commit that referenced this pull request Oct 26, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

- When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor
property is expected to change the icon and text color of the disabled
Tab. On windows the TabBarDisabledColor is not applied, and the TabBar
continues to use the default system disabled color.

- Additionally, on the initial load, only the tab text appeared disabled
while the tab icon continued to display with the enabled color until a
later update.


### Root Cause:
**Missing TabBarDisabledColor application**

- UpdateAppearance() never propagated EffectiveTabBarDisabledColor to
the native WinUI controls, so the configured TabBarDisabledColor was
ignored and the default system disabled color was used instead.

**Incorrect initial disabled icon color**

- During SetValues(), IsEnabled was assigned before the disabled
foreground brush. As a result, UpdateForeground()executed before
DisabledForeground was available, causing the icon to use the default
foreground.
- In addition, WinUI applies its Disabled visual state immediately when
IsEnabled changes, which could override the custom icon foreground
during the initial load.

### Description of change:

- Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled
text color through the WinUI TopNavigationViewItemForegroundDisabled
theme resource and propagate the disabled foreground brush to existing
NavigationViewItemViewModel instances.
- Added a DisabledForeground property to NavigationViewItemViewModel and
updated the foreground logic to use it whenever the item is disabled.
- Updated the icon setter to reapply the foreground after the icon
element is created, ensuring the custom disabled color overrides WinUI's
initial visual-state transition.
- Updated ShellItemHandler.Windows so UpdateAppearance() applies the
disabled color, and reordered SetValues() to assign DisabledForeground
before IsEnabled, ensuring the correct brush is available when the
disabled state is applied.


### Validated the behavior in the following platforms
- [ ] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Fixes
Fixes #34738 

### Screenshots
| Before  | After |
|---------|--------|
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/c8980378-7f4c-414d-ba68-d1760f24c8f6">
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/9a5a6a5f-2301-4d75-95f8-27306c97072e"> 
|
github-actions Bot pushed a commit that referenced this pull request Oct 28, 2026
<!-- Please let the below note in for people that find this PR -->
> [!NOTE]
> Are you waiting for the changes in this PR to be merged?
> It would be very helpful if you could [test the resulting
artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from
this PR and let us know in a comment if this change resolves your issue.
Thank you!

### Issue Details:

- When a Tab is disabled (IsEnabled = false), the TabBarDisabledColor
property is expected to change the icon and text color of the disabled
Tab. On windows the TabBarDisabledColor is not applied, and the TabBar
continues to use the default system disabled color.

- Additionally, on the initial load, only the tab text appeared disabled
while the tab icon continued to display with the enabled color until a
later update.


### Root Cause:
**Missing TabBarDisabledColor application**

- UpdateAppearance() never propagated EffectiveTabBarDisabledColor to
the native WinUI controls, so the configured TabBarDisabledColor was
ignored and the default system disabled color was used instead.

**Incorrect initial disabled icon color**

- During SetValues(), IsEnabled was assigned before the disabled
foreground brush. As a result, UpdateForeground()executed before
DisabledForeground was available, causing the icon to use the default
foreground.
- In addition, WinUI applies its Disabled visual state immediately when
IsEnabled changes, which could override the custom icon foreground
during the initial load.

### Description of change:

- Added UpdateTopNavigationViewItemDisabledColor() to apply the disabled
text color through the WinUI TopNavigationViewItemForegroundDisabled
theme resource and propagate the disabled foreground brush to existing
NavigationViewItemViewModel instances.
- Added a DisabledForeground property to NavigationViewItemViewModel and
updated the foreground logic to use it whenever the item is disabled.
- Updated the icon setter to reapply the foreground after the icon
element is created, ensuring the custom disabled color overrides WinUI's
initial visual-state transition.
- Updated ShellItemHandler.Windows so UpdateAppearance() applies the
disabled color, and reordered SetValues() to assign DisabledForeground
before IsEnabled, ensuring the correct brush is available when the
disabled state is applied.


### Validated the behavior in the following platforms
- [ ] Android
- [x] Windows
- [ ] iOS
- [ ] Mac

### Fixes
Fixes #34738 

### Screenshots
| Before  | After |
|---------|--------|
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/c8980378-7f4c-414d-ba68-d1760f24c8f6">
|  <img width="1250" height="907"
src="https://github.com/user-attachments/assets/9a5a6a5f-2301-4d75-95f8-27306c97072e"> 
|
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 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 partner/syncfusion Issues / PR's with Syncfusion collaboration platform/windows s/agent-changes-requested AI agent recommends changes - found a better alternative or issues s/agent-fix-win AI found a better alternative fix than the PR s/agent-gate-failed AI could not verify tests catch the bug s/agent-reviewed PR was reviewed by AI agent workflow (full 4-phase review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Windows] TabBarDisabledColor is not applied when the TabBar is in a disabled state

5 participants