Skip to content

Support Binding.DoNothing in data bindings - #39954

Merged
kubaflo merged 1 commit into
dotnet:candidate/11.0.1xx-sr2from
fmazzant:fix-11740-binding-donothing
Nov 10, 2026
Merged

kubaflo merged 1 commit into
dotnet:candidate/11.0.1xx-sr2from
fmazzant:fix-11740-binding-donothing

Conversation

@fmazzant

@fmazzant fmazzant commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Add handling for Binding.DoNothing in value converters to skip target/source updates in BindingExpression and TypedBinding. Introduce BindingDoNothingTests to verify correct behavior for one-way, two-way, initial binding, TargetNullValue, and StringFormat scenarios.

Fixes #11740

@fmazzant
fmazzant temporarily deployed to copilot-pat-pool November 6, 2026 06:30 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Nov 6, 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 -- 39954

Or

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

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@fmazzant
fmazzant temporarily deployed to copilot-pat-pool November 6, 2026 06:30 — with GitHub Actions Inactive
@dotnet-policy-service dotnet-policy-service Bot added the community ✨ Community Contribution label Nov 6, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@fmazzant
fmazzant temporarily deployed to copilot-pat-pool November 6, 2026 06:31 — with GitHub Actions Inactive
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

@fmazzant

fmazzant commented Nov 6, 2026 via email

Copy link
Copy Markdown
Contributor Author

Add handling for Binding.DoNothing in value converters to skip target/source updates in BindingExpression and TypedBinding. Introduce BindingDoNothingTests to verify correct behavior for one-way, two-way, initial binding, TargetNullValue, and StringFormat scenarios.
@fmazzant
fmazzant force-pushed the fix-11740-binding-donothing branch from 52f0150 to 98ba970 Compare November 6, 2026 07:12
@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 Nov 6, 2026
@kubaflo

This comment has been minimized.

@azure-pipelines

This comment has been minimized.

@github-actions github-actions Bot 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.

Expert Review — 0 findings

Reviewed commit 98ba970.

Source assessment incomplete (6/7 dimensions); finding count is partial.

@MauiBot

MauiBot commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

PR Test Gate

@fmazzant — existing-test verification for commit 98ba970c.

Result PASSED Platform Android Commit 98ba970c


🧪 Gate analysis — click to expand

✅ Passed. The selected verification satisfied the gate's passing conditions. Unmatched, skipped, or inconclusive groups are not passing evidence.

🧪 Unit tests
Test group Without fix With fix
BindingDoNothingTests ✅ Failed as expected (76s) ✅ Passed (45s)
Execution log excerpts

Without fix BindingDoNothingTests

     at Microsoft.Maui.Controls.Core.UnitTests.BindingDoNothingTests.DoNothingFromConvertOnInitialApplyKeepsTargetValue() in /_/src/Controls/tests/Core.UnitTests/BindingDoNothingTests.cs:line 57
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
     at Microsoft.Maui.Controls.Core.UnitTests.BindingDoNothingTests.DoNothingFromConvertDoesNotUpdateTarget() in /_/src/Controls/tests/Core.UnitTests/BindingDoNothingTests.cs:line 45
     at Microsoft.Maui.Controls.Core.UnitTests.BindingDoNothingTests.TypedBindingDoNothingFromConvertDoesNotUpdateTarget() in /_/src/Controls/tests/Core.UnitTests/BindingDoNothingTests.cs:line 95
     at Microsoft.Maui.Controls.Core.UnitTests.BindingDoNothingTests.DoNothingFromConvertDoesNotApplyTargetNullValueOrStringFormat() in /_/src/Controls/tests/Core.UnitTests/BindingDoNothingTests.cs:line 69

With fix BindingDoNothingTests

  Determining projects to restore...
  All projects are up-to-date for restore.
Test run for /home/vsts/work/1/s/artifacts/bin/Controls.Core.UnitTests/Debug/net11.0/Microsoft.Maui.Controls.Core.UnitTests.dll (.NETCoreApp,Version=v11.0)
A total of 1 test files matched the specified pattern.
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 11.0.0)
[xUnit.net 00:00:00.39]   Discovering: Microsoft.Maui.Controls.Core.UnitTests
[xUnit.net 00:00:03.81]   Discovered:  Microsoft.Maui.Controls.Core.UnitTests
[xUnit.net 00:00:03.83]   Starting:    Microsoft.Maui.Controls.Core.UnitTests
[xUnit.net 00:00:03.99]   Finished:    Microsoft.Maui.Controls.Core.UnitTests
  Passed DoNothingFromConvertOnInitialApplyKeepsTargetValue [48 ms]
  Passed DoNothingFromConvertDoesNotUpdateTarget [5 ms]
  Passed TypedBindingDoNothingFromConvertBackDoesNotUpdateSource [12 ms]
  Passed TypedBindingDoNothingFromConvertDoesNotUpdateTarget [< 1 ms]
  Passed DoNothingFromConvertBackDoesNotUpdateSource [1 ms]
  Passed DoNothingFromConvertDoesNotApplyTargetNullValueOrStringFormat [< 1 ms]
Test Run Successful.
Total tests: 6
     Passed: 6
 Total time: 5.0800 Seconds

PR head: 98ba970c.

Without-fix baseline: ae2a26c6.

@MauiBot MauiBot added s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix) and removed s/agent-review-in-progress AI review is currently running for this PR labels Nov 6, 2026
@kubaflo
kubaflo changed the base branch from main to candidate/11.0.1xx-sr2 November 10, 2026 21:54
@kubaflo
kubaflo merged commit d7ec83f into dotnet:candidate/11.0.1xx-sr2 Nov 10, 2026
144 of 177 checks passed
kubaflo added a commit that referenced this pull request Nov 11, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 13, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 16, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 17, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 18, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 19, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 22, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
kubaflo added a commit that referenced this pull request Nov 23, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes #11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@kubaflo kubaflo added this to the .NET 11 SR2 milestone Nov 24, 2026
KarthikRajaKalaimani pushed a commit to KarthikRajaKalaimani/maui that referenced this pull request Nov 26, 2026
Add handling for Binding.DoNothing in value converters to skip
target/source updates in BindingExpression and TypedBinding. Introduce
BindingDoNothingTests to verify correct behavior for one-way, two-way,
initial binding, TargetNullValue, and StringFormat scenarios.

 Fixes dotnet#11740

Co-authored-by: Jakub Florkowski <42434498+kubaflo@users.noreply.github.com>
@fmazzant
fmazzant deleted the fix-11740-binding-donothing branch December 2, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community ✨ Community Contribution s/agent-gate-passed AI verified tests catch the bug (fail without fix, pass with fix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maui Binding does not respect Binding.DoNothing returned from IValueConverter

3 participants