Skip to content

[release/10.0.1xx-sr5] [Regression] Fix TypedBinding nested property re-subscription (#34428)#34450

Merged
PureWeen merged 1 commit intorelease/10.0.1xx-sr5from
backport/pr-34449-to-release/10.0.1xx-sr5
Mar 13, 2026
Merged

[release/10.0.1xx-sr5] [Regression] Fix TypedBinding nested property re-subscription (#34428)#34450
PureWeen merged 1 commit intorelease/10.0.1xx-sr5from
backport/pr-34449-to-release/10.0.1xx-sr5

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

Backport of #34449 to release/10.0.1xx-sr5

/cc @StephaneDelcroix

@PureWeen
Copy link
Copy Markdown
Member

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

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

…ate becomes non-null

When an intermediate object in a TypedBinding path starts as null and later
becomes non-null (or is replaced with a different object), the binding must
re-establish INPC subscriptions to the new object's nested properties.

The previous optimization used a '_isSubscribed' boolean flag to skip
IPropertyChangeHandler.Subscribe() after the first Apply. This prevented
re-subscribing when intermediate objects changed. For example:

  vm.Child = null  // subscribe to vm, but NOT vm.Child.Name (null)
  vm.Child = new Child()  // Subscribe skipped due to _isSubscribed=true
  vm.Child.Name = "x"  // binding never fires — regression!

The fix removes '_isSubscribed' and always calls Subscribe on each Apply.
Both IPropertyChangeHandler implementations (PropertyChangeHandler and
LegacyPropertyChangeHandler) are already idempotent — they use reference
equality checks to avoid re-subscribing to unchanged objects — so calling
Subscribe on every Apply is safe and has minimal overhead.

Adds two regression tests:
- TypedBinding_NestedProperty_ResubscribesAfterNullIntermediateBecomesNonNull
- TypedBinding_NestedProperty_ResubscribesAfterIntermediateReplaced

Reported in: #32382 (comment)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions bot force-pushed the backport/pr-34449-to-release/10.0.1xx-sr5 branch from b9528f1 to 12c693e Compare March 13, 2026 09:35
@PureWeen PureWeen merged commit 55acfe9 into release/10.0.1xx-sr5 Mar 13, 2026
35 checks passed
@PureWeen PureWeen deleted the backport/pr-34449-to-release/10.0.1xx-sr5 branch March 13, 2026 14:52
evgenygunko pushed a commit to evgenygunko/CopyWordsDA that referenced this pull request Mar 26, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [Microsoft.Maui.Controls](https://github.com/dotnet/maui) | nuget | patch | `10.0.50` -> `10.0.51` |

---

### Release Notes

<details>
<summary>dotnet/maui (Microsoft.Maui.Controls)</summary>

### [`v10.0.51`](https://github.com/dotnet/maui/releases/tag/10.0.51): SR5.1

[Compare Source](dotnet/maui@10.0.50...10.0.51)

#### What's Changed

-   Increment patch version from 50 to 51 by [@&#8203;PureWeen](https://github.com/PureWeen) in dotnet/maui#34458
-   \[release/10.0.1xx-sr5] \[Regression] Fix TypedBinding nested property re-subscription ([#&#8203;34428](dotnet/maui#34428)) by [@&#8203;github-actions](https://github.com/github-actions)\[bot] in dotnet/maui#34450
-   \[backport 10.0.1xx-sr5] Fix MAUIG2045 false positive with x:Reference source in DataTemplate by [@&#8203;StephaneDelcroix](https://github.com/StephaneDelcroix) in dotnet/maui#34525

**Full Changelog**: dotnet/maui@10.0.50...10.0.51

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or PR is renamed to start with "rebase!".

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
TheCodeTraveler pushed a commit to TheCodeTraveler/MAUIChatGPTClone that referenced this pull request Mar 26, 2026
Updated [Microsoft.Maui.Controls](https://github.com/dotnet/maui) from
10.0.50 to 10.0.51.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Maui.Controls's
releases](https://github.com/dotnet/maui/releases)._

## 10.0.51

## What's Changed
* Increment patch version from 50 to 51 by @​PureWeen in
dotnet/maui#34458
* [release/10.0.1xx-sr5] [Regression] Fix TypedBinding nested property
re-subscription (#​34428) by @​github-actions[bot] in
dotnet/maui#34450
* [backport 10.0.1xx-sr5] Fix MAUIG2045 false positive with x:Reference
source in DataTemplate by @​StephaneDelcroix in
dotnet/maui#34525


**Full Changelog**:
dotnet/maui@10.0.50...10.0.51

Commits viewable in [compare
view](dotnet/maui@10.0.50...10.0.51).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Maui.Controls&package-manager=nuget&previous-version=10.0.50&new-version=10.0.51)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Mar 30, 2026
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