Repository navigation
Fix default styles for derived NavigationPage and TabbedPage - #38593
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 38593Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 38593" |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
|
Hey there @@SubhikshaSf4851! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
This comment has been minimized.
This comment has been minimized.
MauiBot
left a comment
There was a problem hiding this comment.
Expert Review — 1 findings
See inline comments for details.
MauiBot
left a comment
There was a problem hiding this comment.
AI Review Summary
@SubhikshaSf4851 — new AI review results are available based on commit
10a44ca.
🗂️ Review Sessions — click to expand
🚦 Gate — Test Before & After Fix
Gate Result: ⚠️ SKIPPED
No tests were detected in this PR.
Recommendation: Add tests to verify the fix using the write-tests-agent.
📋 Pre-Flight — Context & Validation
PR #38593 Pre-Flight
Scope
- Title:
[WIP] Fix default styles for derived NavigationPage and TabbedPage - Issue: #38400,
[Android] TabbedPage BarBackgroundColor does not work with Theme change - Platform: Android
- Base / materialized head:
origin/main/e39022b5de291cb0145a2f07b6a471e8547d2c88 - Gate: Skipped because the PR adds no tests. The gate must not be rerun.
Problem
The default template's implicit TabbedPage style is not applied to a user-defined
CustomTabbedPage. On Android, its BarBackgroundColor therefore does not follow
the style's AppThemeBinding when Application.UserAppTheme changes. The linked
reproduction creates a derived TabbedPage, puts derived/content pages inside it,
and switches between light and dark themes.
Existing PR Fix
The PR changes only
src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml:
- <Style TargetType="NavigationPage">
+ <Style TargetType="NavigationPage" ApplyToDerivedTypes="True">
...
- <Style TargetType="TabbedPage">
+ <Style TargetType="TabbedPage" ApplyToDerivedTypes="True">Its hypothesis is that base-type implicit styles need ApplyToDerivedTypes="True"
so generated apps' derived navigation controls receive the default setters and
their theme bindings. The issue specifically demonstrates a derived TabbedPage;
the PR also broadens the NavigationPage style.
Relevant Context
- The analogous multiproject template still has implicit
NavigationPageand
TabbedPagestyles withoutApplyToDerivedTypes. PageandShellstyles in both templates already use
ApplyToDerivedTypes="True".- The PR initially tried handler/sample changes, reverted them, and converged on
the template-only change. - No review comments propose an alternative, and no PR tests are present.
- The template instructions require building
src/Templates/src/Microsoft.Maui.Templates.csprojafter template changes.
Bounded Validation
No primary regression test was detected and no additional mandatory regression
tests were supplied for STEP 5a. Each candidate may run only this targeted
template-project validation:
dotnet build src/Templates/src/Microsoft.Maui.Templates.csproj --no-restoreThis checks template packaging/XAML inputs but cannot prove the Android runtime
theme-switch behavior. Any candidate must report that limitation honestly.
Try-Fix Boundaries
- Each attempt must use
EstablishBrokenBaseline.ps1, obey
.github/.baseline-state.json, and restore using the script. - The expected production-file allow-list is the one PR-modified file above.
- Existing unrelated worktree changes under
.github/andeng/are
pre-existing and must remain untouched. - Candidate 2 must use candidate 1's recorded result and choose a different
mechanism; it must not reopen or rerun candidate 1.
🔬 Code Review — Deep Analysis
Expert PR Evaluation — PR #38593
Independent Assessment
What this changes: The submitted patch makes the default implicit NavigationPage and TabbedPage styles in the maui-mobile template apply to derived page types.
Inferred motivation: A generated application's custom subclass otherwise does not receive the base control's implicit style, so its bar colors and AppThemeBinding values do not update as intended.
Reconciliation with PR Narrative
The stated root cause and behavior are correct for src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml. The submitted fix is incomplete across the template family because the analogous styles in src/Templates/src/templates/maui-multiproject/MauiApp.1/Resources/Styles/Styles.xaml still omit ApplyToDerivedTypes="True".
Prior Review Reconciliation
No prior error-level review findings were found.
Blast Radius Assessment
- Runs for all instances: The implicit styles affect every
NavigationPageandTabbedPagecreated from the changed template, including derived types after this patch. - Startup impact: No direct startup or initialization risk; the change affects style selection and theme-bound values.
- Static/shared state: None.
- Template scope: Only
maui-mobileis corrected;maui-multiprojectretains the defect.
CI Status
- Gate result: Skipped because the submitted PR contains no tests.
- Required-check result: Could not be established through authenticated
gh; available anonymous check data was not sufficient to prove relevant runtime coverage. - Classification: Coverage is undetermined. The permitted template build cannot prove Android theme switching on a derived page.
Findings
❌ Error — The equivalent multiproject template remains broken
The added attribute at src/Templates/src/templates/maui-mobile/Resources/Styles/Styles.xaml:452 and :458 fixes only the single-project template. The corresponding NavigationPage and TabbedPage styles at src/Templates/src/templates/maui-multiproject/MauiApp.1/Resources/Styles/Styles.xaml:398 and :404 still do not apply to derived types. A custom derived page generated from that template therefore continues to miss the default theme-bound bar colors.
Failure-Mode Probing
- Derived pages generated from
maui-mobile: They now receive the intended default setters and theme bindings. - Derived pages generated from
maui-multiproject: They still do not receive those setters, leaving the reported behavior reproducible for that template. - Exact
NavigationPageandTabbedPageinstances: Their existing implicit-style behavior is unchanged. - Explicit styles on a derived page: Normal style precedence remains available; this patch only broadens implicit base-style applicability.
- Theme changes: The binding can update only when the style is attached, which remains inconsistent between template variants.
External Output Contract
Not applicable.
Verdict: NEEDS_CHANGES
Confidence: medium
Summary: The chosen ApplyToDerivedTypes mechanism directly addresses the root cause and is consistent with the neighboring Page and Shell styles. The submitted scope is incomplete, and the absence of a targeted regression test leaves the Android runtime behavior unverified. One consolidated reviewer candidate should update both matching styles in the multiproject template and add focused regression coverage.
🛠️ Try-Fix — Analysis & Comparison
PR #38593 Alternative Fix Candidates
Candidate 1 — Explicit keyed style composition
Model: gpt-5.3-codex
Approach: Avoid the PR's ApplyToDerivedTypes="True" propagation and
instead compose shared keyed base styles into explicitly targeted derived-type
implicit styles, so theme-bound setters would flow through direct style
selection rather than base-type style propagation.
Prior approach avoided: The PR adds ApplyToDerivedTypes="True" to the
implicit NavigationPage and TabbedPage styles. This candidate intended to
replace that framework propagation mechanism with keyed BasedOn composition
and direct derived-type targeting.
Files changed: None.
Result: Blocked
Diff: Empty.
Validation: The required command,
dotnet build src/Templates/src/Microsoft.Maui.Templates.csproj --no-restore,
was not run. pwsh .github/scripts/EstablishBrokenBaseline.ps1 rejected the
pre-existing dirty worktree before creating .github/.baseline-state.json.
Without the RevertedFiles allow-list, the skill prohibits production edits
and testing.
Failure analysis: The blocker is environmental, not an implementation or
test result. The worktree already contained many unrelated tracked changes
under .github/ and eng/. Those changes were preserved. The exact required
restore command, pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore,
ran and reported No baseline state found / Restored False, which is the
expected no-state outcome after baseline establishment fails before edits.
Inline expert self-review: 0 findings; there was no code diff to review.
Artifacts: CustomAgentLogsTmp/PRState/38593/PRAgent/try-fix/attempt-1/
and CustomAgentLogsTmp/PRState/38593/PRAgent/try-fix-1/content.md.
Candidate 2 — Style-independent theme resource indirection
Model: gpt-5.6-sol
Candidate 1 incorporated: Candidate 1's keyed/shared BasedOn
composition and direct derived-type targeting was recorded as blocked at
baseline establishment. Candidate 2 neither reopened nor reran it.
Approach: Test a different root-cause hypothesis: move theme selection out
of the directly embedded AppThemeBinding and into an application-level
dynamic resource, so theme changes refresh through resource lookup rather than
through derived-type implicit-style propagation.
Prior approaches avoided: This candidate used neither the PR's
ApplyToDerivedTypes="True" mechanism nor candidate 1's keyed/shared
BasedOn composition or direct derived-type targeting.
Mechanism-level analysis: Resource lookup occurs only after a setter
attaches the resource to BarBackgroundColor. The reported defect occurs
earlier: the unknown CustomTabbedPage receives no setter because its base
implicit style is not selected. Within the only permitted production file,
making that setter reach an unknown derived type necessarily returns to either
derived-type propagation or explicit targeting/composition. The distinct
resource-indirection chain therefore cannot independently fix the issue.
Files changed: None.
Result: Blocked
Diff: Empty.
Validation: The required command,
dotnet build src/Templates/src/Microsoft.Maui.Templates.csproj --no-restore,
was not run. Baseline establishment again failed before producing an edit
allow-list.
Failure analysis: pwsh .github/scripts/EstablishBrokenBaseline.ps1 rejected the same pre-existing
unrelated tracked changes under .github/ and eng/. The task prohibited
cleaning, stashing, committing, resetting, or bypassing them. This
environmental blocker independently prevented implementation. The candidate
also determined that its distinct mechanism was semantically incomplete under
the one-file boundary, so spending the correction budget would not have
created a valid alternative.
Inline expert self-review: 0 findings; there was no code diff to review.
Restoration: The exact required command, pwsh .github/scripts/EstablishBrokenBaseline.ps1 -Restore, ran and reported No baseline state found / Restored False, the expected outcome because no
baseline state or candidate edit existed.
Artifacts: CustomAgentLogsTmp/PRState/38593/PRAgent/try-fix/attempt-2/
and CustomAgentLogsTmp/PRState/38593/PRAgent/try-fix-2/content.md.
Aggregate Outcome
Two candidates were considered, in the required model order. Both were blocked
before implementation by the baseline script's dirty-worktree safeguard, and
neither changed production code or ran validation. Candidate 2 additionally
showed that resource indirection cannot bypass the missing style attachment.
Under the current Styles.xaml-only boundary, no empirically validated
alternative to ApplyToDerivedTypes was produced.
📝 PR Finalize — Recommended Title & Description
Assessment: ✏️ Recommend updating — the current title retains a [WIP] prefix and the description does not identify that the submitted diff changes only the maui-mobile template.
Recommended title
[Templates] NavigationPage and TabbedPage: Apply default styles to derived types
Recommended description
### Root Cause
The default implicit `NavigationPage` and `TabbedPage` styles in the `maui-mobile` template's `Resources/Styles/Styles.xaml` did not apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters or their theme bindings.
### Description of Change
- Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style.
- Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style.
This ensures that derived pages created from the `maui-mobile` template receive the expected default colors and `AppThemeBinding` values, including updates when the application theme changes.
### Issues Fixed
Fixes #38400
### Tested the behavior in the following platforms
- [x] Windows
- [x] Android
- [x] iOS
- [x] Mac
| Before Issue Fix | After Issue Fix |
|---|---|
| <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> |
🏁 Report — Final Recommendation
⚠️ Final Recommendation: REQUEST CHANGES
Winner: pr-plus-reviewer
pr-plus-reviewer preserves the submitted root-cause fix and closes the expert reviewer's concrete completeness gap by applying it to both MAUI app template variants. Its sole permitted build was blocked before compilation by a missing project.assets.json; this is an environment prerequisite failure rather than a source or regression-test failure. No candidate passed a regression test, so the recommendation retains explicit runtime uncertainty.
Comparative Ranking
| Rank | Candidate | Implementation | Regression evidence | Expert assessment | Decision |
|---|---|---|---|---|---|
| 1 | pr-plus-reviewer |
Applies ApplyToDerivedTypes="True" to NavigationPage and TabbedPage styles in both maui-mobile and maui-multiproject |
No regression test; required template build blocked by missing restore assets | Resolves the one major expert finding; diff --check passed |
Winner |
| 2 | pr |
Correct mechanism, but updates only maui-mobile |
Gate skipped because no tests were detected | NEEDS_CHANGES: multiproject-generated apps retain the reported defect |
Lower than winner because scope is incomplete |
| 3 | try-fix-1 |
No implementation; proposed keyed BasedOn composition with direct derived-type targeting |
No validation; blocked by dirty-worktree baseline establishment | No code diff to assess | Non-viable and less general because unknown user-derived types cannot be explicitly targeted by the template |
| 4 | try-fix-2 |
No implementation; considered theme resource indirection | No validation; blocked by dirty-worktree baseline establishment | Its own analysis shows the mechanism cannot attach a missing setter | Non-viable because resource refresh cannot replace style selection |
Why the Winner Is Better
The reported failure occurs because an implicit style targeting a base type is not selected for an unknown derived type. ApplyToDerivedTypes addresses that selection point directly and matches the neighboring template styles for Page and Shell. Extending the same correction to maui-multiproject prevents template-dependent behavior and requires only two additional declarative attributes.
The try-fix candidates do not compete on empirical results: both were blocked before producing code or running validation. Candidate 1's explicit-target approach cannot name arbitrary future user subclasses, and candidate 2 correctly concludes that a dynamic resource is ineffective until a style setter is attached.
Required Change to the Submitted PR
Add ApplyToDerivedTypes="True" to the implicit NavigationPage and TabbedPage styles in:
src/Templates/src/templates/maui-multiproject/MauiApp.1/Resources/Styles/Styles.xaml
The submitted PR should also gain focused regression coverage when a runnable Android/template test path is available. Current evidence does not verify the runtime theme-switch scenario.
Validation Accounting
- Submitted
pr: gate skipped; no tests detected. pr-plus-reviewer: source diff hygiene passed; template build attempted once and blocked by missing restore assets.try-fix-1: no code and no validation.try-fix-2: no code and no validation.- Failed-regression-test ordering rule: no candidate produced a failed regression test, and no candidate produced a passing regression test.
🧭 Next Steps — reviewer changes required
The reviewer-enhanced candidate identified changes that are not yet in the submitted PR.
Why: The reviewer-enhanced candidate keeps the submitted root-cause fix and applies it consistently to both the single-project and multiproject MAUI templates. Its required build was blocked by missing restore assets, but it is the only implemented candidate that resolves the expert reviewer's confirmed template-family gap.
Address the actionable findings in this review before merging.
This comment has been minimized.
This comment has been minimized.
|
Warning Your |
|
Azure Pipelines: Successfully started running 1 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
This comment has been minimized.
This comment has been minimized.
|
Warning Your |
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
<!-- Please keep the note below for people who 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 whether this change resolves your issue. Thank you! ### Root Cause The default `NavigationPage` and `TabbedPage` styles in `Styles.xaml` were not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings. <!-- Enter description of the fix in this section --> ### Description of change - Added `ApplyToDerivedTypes="True"` to the default `NavigationPage` style. - Added `ApplyToDerivedTypes="True"` to the default `TabbedPage` style. This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> Fixes #38400 ### Tested the behavior in the following platforms - [x] Windows - [x] Android - [x] iOS - [x] Mac | Before Issue Fix | After Issue Fix | |----------|----------| | <video src="https://github.com/user-attachments/assets/b706345f-1fd2-4fcc-8fe0-36388bddfc81"> | <video src="https://github.com/user-attachments/assets/af009220-a470-4ce4-82b0-e294895f0756"> | <!-- Are you targeting main? All PRs should target the main branch unless otherwise noted. -->
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 whether this change resolves your issue. Thank you!
Root Cause
The default
NavigationPageandTabbedPagestyles inStyles.xamlwere not configured to apply to derived types. As a result, custom pages inheriting from these controls did not receive the default style setters and theme bindings.Description of change
ApplyToDerivedTypes="True"to the defaultNavigationPagestyle.ApplyToDerivedTypes="True"to the defaultTabbedPagestyle.This ensures that derived pages receive the expected default colors and AppThemeBinding values, including updates when the application theme changes.
Issues Fixed
Fixes #38400
Tested the behavior in the following platforms
BeforeFix38400.mov
AfterFix38400.mov