Skip to content

WI01086104 - Fix Group 1 NRE: empty-parent AddNew on RelatedCurrencyManager#14636

Closed
FahmiFuzi wants to merge 158 commits into
dotnet:mainfrom
WiseTechGlobal:WI01086104-FixGroup1
Closed

WI01086104 - Fix Group 1 NRE: empty-parent AddNew on RelatedCurrencyManager#14636
FahmiFuzi wants to merge 158 commits into
dotnet:mainfrom
WiseTechGlobal:WI01086104-FixGroup1

Conversation

@FahmiFuzi

@FahmiFuzi FahmiFuzi commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Fixes the .NET 10 Group 1 NullReferenceException failures (39 failures in crikey run 27ca6b55) by replicating the .NET Framework ZBindingContext.ParentCurrentChangedHandler empty-parent behavior in the fork's rewired CurrentChanged handler path.

When a parent currency manager has no current row (Count == 0), the child manager now binds an empty list (AllowNew=false) instead of calling AddNew(), which materializes orphaned business objects whose SetDefaultsForNewChild/property getters dereference null parent navigations.

Changes

RelatedCurrencyManager.cs:

  1. RewireParentChangeHandler: Wires parent CurrentChanged to new ParentManager_CurrentChanged (instead of stock handler) and primes through it.

  2. New ParentManager_CurrentChanged (port of FW ParentCurrentChangedHandler):

    • Empty parent (Count == 0) → SetDataSource(new BindingList<object> { AllowNew=false, AllowEdit=false, AllowRemove=false }) + listposition = -1 + raise OnPositionChanged/OnCurrentChanged/OnCurrentItemChanged
    • Non-empty parent → delegate to stock ParentManager_CurrentItemChanged
  3. ParentManager_CurrentItemChanged: One-line guard change (combines with LV1 WI01086017):

    • elseelse if (currencyManager.List is IBindingList { AllowNew: true })
    • Skips AddNew on read-only lists (including the empty placeholder for rewired managers)
    • Everett body unchanged

Why This Works

Ctor-priming coverage: EnsureListManager is recursive — each parent manager is registered + rewired before the next child is constructed. By the time a child's constructor primes, its empty parent already holds the AllowNew=false placeholder and the guard skips the Everett AddNew. This is the same inter-construction interception window that .NET Framework's BindingContextHashtable.Add used.

Guard+placeholder are interdependent: Without the guard, AddNew on the placeholder BindingList<object> would insert a bare object() and _fieldInfo.GetValue would throw.

Test Plan

  • Customs.DE ExitSummaryPlugInTest.TestBashUserControlOfPlugIn (was NRE in SetDefaultsForNewChild) — PASS
  • MarketingManager GlbCompanyCampaignFormTest.TestBashingForm (was NRE in get_TrackingStatusDescription) — NRE eliminated (0 signatures in TRX)
  • Earlier broad run: 23/23 tests across 11 assemblies NRE-free (12 full PASS, 11 fail on pre-existing Group 7 ZGrid/DataGrid issues)

Residual Issues

Tests that still fail after the fix fail on previously-masked issues (not Group 1):

  • Legacy DataGrid GridColumnStylesCollection index out-of-range
  • ZGrid ColumnName validation (Group 7)
  • Layout/translation assertions (Group 9)

These are separate from the Group 1 NRE and can be addressed in follow-up work.

Notes

  • StyleCop SA1513: comments cannot sit between } and else if — moved inside the block
  • To ship: pack WTG.Windows.Forms (use Create Release GH workflow per src/System.Windows.Forms.Legacy/how-to-release-nuget-package.md) and bump CargoWise Directory.Packages.props from 0.2.2-pr.17.1

Co-authored-by: Fahmi Fuzi fahmi.fuzi@wisetechglobal.com

Microsoft Reviewers: Open in CodeFlow

dotnet-maestro Bot and others added 30 commits August 16, 2025 02:07
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25414.103 -> 10.0.0-beta.25414.111)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.1.25414.103 -> 10.0.0-rc.1.25414.111)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25414.111 -> 10.0.0-beta.25416.105)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.1.25414.111 -> 10.0.0-rc.2.25416.105)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25416.105 -> 10.0.0-beta.25420.109)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.2.25416.105 -> 10.0.0-rc.2.25420.109)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25420.109 -> 10.0.0-beta.25426.115)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.2.25420.109 -> 10.0.0-rc.2.25426.115)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25426.115 -> 10.0.0-beta.25427.104)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.2.25426.115 -> 10.0.0-rc.2.25427.104)
Backport of dotnet#13820 to release/10.0

/cc @Epica3055

## Proposed changes

- add a condition whether there is a specified color or not


## fixed Controls
TextBox, DomainUpDown, NumericUpDown, RichTextBox, MaskedTextBox 

<!-- 

## Customer Impact

- 
- 

## Regression? 

- Yes / No

## Risk

-

 -->


## Screenshots <!-- Remove this section if PR does not change UI -->

### Before

<img width="516" height="549" alt="image"
src="https://github.com/user-attachments/assets/4e48b944-20bd-4ddf-86e7-c41ba3256cd5"
/>

### After

<img width="568" height="553" alt="image"
src="https://github.com/user-attachments/assets/228983f4-92da-4f81-97a2-455411b038e2"
/>


## Test methodology <!-- How did you ensure quality? -->

- manual
> [!NOTE]
> This is a codeflow update. It may contain both source code changes
from [the VMR](https://github.com/dotnet/dotnet) as well as dependency
updates. Learn more
[here](https://github.com/dotnet/dotnet/tree/main/docs/Codeflow-PRs.md).

This pull request brings the following source code changes





[marker]: <> (Begin:7442e8e7-a558-4305-8b1f-3fa7e892b4a1)

## From https://github.com/dotnet/dotnet
- **Subscription**:
[7442e8e7-a558-4305-8b1f-3fa7e892b4a1](https://maestro.dot.net/subscriptions?search=7442e8e7-a558-4305-8b1f-3fa7e892b4a1)
- **Build**:
[20250827.4](https://dev.azure.com/dnceng/internal/_build/results?buildId=2781079)
- **Date Produced**: August 28, 2025 3:27:44 AM UTC
- **Commit**:
[7ac1ca67bb1fb8a381c1c94a9f82a97725f0ccf3](dotnet/dotnet@7ac1ca6)
- **Commit Diff**:
[5088919...7ac1ca6](dotnet/dotnet@5088919...7ac1ca6)
- **Branch**:
[release/10.0.1xx](https://github.com/dotnet/dotnet/tree/release/10.0.1xx)

**Updated Dependencies**
- From [10.0.0-beta.25414.103 to 10.0.0-beta.25427.104][5]
  - Microsoft.DotNet.Arcade.Sdk
  - Microsoft.DotNet.CMake.Sdk
  - Microsoft.DotNet.GenFacades
  - Microsoft.DotNet.Helix.Sdk
  - Microsoft.DotNet.RemoteExecutor
  - Microsoft.DotNet.XUnitV3Extensions
- From [10.0.0-rc.1.25414.103 to 10.0.0-rc.2.25427.104][5]
  - Microsoft.NET.Sdk.IL
  - Microsoft.NETCore.App.Ref
  - Microsoft.NETCore.ILAsm
  - Microsoft.NETCore.ILDAsm
  - Microsoft.NETCore.Platforms
  - Microsoft.Win32.SystemEvents
  - runtime.win-x64.Microsoft.NETCore.ILAsm
  - runtime.win-x86.Microsoft.NETCore.ILAsm
  - System.CodeDom
  - System.Configuration.ConfigurationManager
  - System.Formats.Nrbf
  - System.IO.Hashing
  - System.Reflection.MetadataLoadContext
  - System.Resources.Extensions
  - System.Runtime.Serialization.Formatters
  - System.Text.Encodings.Web
  - System.Text.Json
  - System.Windows.Extensions

[marker]: <> (End:7442e8e7-a558-4305-8b1f-3fa7e892b4a1)





[1]: dotnet/dotnet@5088919...f8a57b6

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/13815)
[2]: dotnet/dotnet@5088919...a01724d

[3]: dotnet/dotnet@5088919...619d563

[4]: dotnet/dotnet@5088919...39ec54d

[5]: dotnet/dotnet@5088919...7ac1ca6
[marker]: <> (Start:Footer:CodeFlow PR)

## Associated changes in source repos
-
dotnet/arcade@ea9e51a...f2cdf94
-
dotnet/aspnetcore@f4e259a...03e9582
-
dotnet/cecil@2a768f2...27abc57
-
dotnet/command-line-api@0b4618b...e292617
-
dotnet/deployment-tools@fb3ca08...0a1e836
-
dotnet/efcore@29a8c97...3aca835
-
dotnet/emsdk@8e74ba4...5160f55
-
dotnet/fsharp@7903428...e513690
-
dotnet/msbuild@279cffc...35f09c0
-
NuGet/NuGet.Client@6a593d0...ef6cddc
-
dotnet/razor@cfc7125...f2270a5
-
dotnet/roslyn@633a6e3...5fc0475
-
dotnet/runtime@f53ffe6...4cf369e
-
dotnet/sdk@1b6d28d...faf4349
-
dotnet/source-build-assets@95e8d43...810a5c5
-
dotnet/templating@b67630f...fcc5f29
-
microsoft/vstest@4d2e4b0...c8ffd9e
-
dotnet/windowsdesktop@5cf429a...e2dc1b2
-
dotnet/wpf@e103fb8...27b82f6

[marker]: <> (End:Footer:CodeFlow PR)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25427.104 -> 10.0.0-beta.25454.105)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.2.25427.104 -> 10.0.0-rc.2.25454.105)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25454.105 -> 10.0.0-beta.25454.107)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.2.25454.105 -> 10.0.0-rc.2.25454.107)
…r properties are not working for the controls (dotnet#13839)

Backport of dotnet#13818 to release/10.0

/cc @Epica3055

## Proposed changes

Add code to see if BackColor or ForeColor is specified in dark mode, if
so then use the specified color, if not then let the renderer decide the
color.

<!-- 

## Customer Impact

- 
- 

## Regression? 

- Yes / No

## Risk

-

 -->

## Screenshots 

### Before

<img width="589" height="574" alt="image"
src="https://github.com/user-attachments/assets/b5c2281e-937f-4e44-8841-552d22fceed7"
/>


### After
<img width="590" height="571" alt="image"
src="https://github.com/user-attachments/assets/9604e7ce-1d69-4b63-a0e1-b57938f9752d"
/>
> [!NOTE]
> This is a codeflow update. It may contain both source code changes
from [the VMR](https://github.com/dotnet/dotnet) as well as dependency
updates. Learn more
[here](https://github.com/dotnet/dotnet/tree/main/docs/Codeflow-PRs.md).

This pull request brings the following source code changes


[marker]: <> (Begin:7442e8e7-a558-4305-8b1f-3fa7e892b4a1)

## From https://github.com/dotnet/dotnet
- **Subscription**:
[7442e8e7-a558-4305-8b1f-3fa7e892b4a1](https://maestro.dot.net/subscriptions?search=7442e8e7-a558-4305-8b1f-3fa7e892b4a1)
- **Build**:
[20250904.7](https://dev.azure.com/dnceng/internal/_build/results?buildId=2786557)
([282086](https://maestro.dot.net/channel/5173/github:dotnet:dotnet/build/282086))
- **Date Produced**: September 5, 2025 6:48:16 AM UTC
- **Commit**:
[96384f46287cd0b6ae49f3885676e3d1635c7894](dotnet/dotnet@96384f4)
- **Commit Diff**:
[7ac1ca6...96384f4](dotnet/dotnet@7ac1ca6...96384f4)
- **Branch**:
[release/10.0.1xx](https://github.com/dotnet/dotnet/tree/release/10.0.1xx)

**Updated Dependencies**
- From [10.0.0-beta.25427.104 to 10.0.0-beta.25454.107][2]
  - Microsoft.DotNet.Arcade.Sdk
  - Microsoft.DotNet.CMake.Sdk
  - Microsoft.DotNet.GenFacades
  - Microsoft.DotNet.Helix.Sdk
  - Microsoft.DotNet.RemoteExecutor
  - Microsoft.DotNet.XUnitV3Extensions
- From [10.0.0-rc.2.25427.104 to 10.0.0-rc.2.25454.107][2]
  - Microsoft.NET.Sdk.IL
  - Microsoft.NETCore.App.Ref
  - Microsoft.NETCore.ILAsm
  - Microsoft.NETCore.ILDAsm
  - Microsoft.NETCore.Platforms
  - Microsoft.Win32.SystemEvents
  - runtime.win-x64.Microsoft.NETCore.ILAsm
  - runtime.win-x86.Microsoft.NETCore.ILAsm
  - System.CodeDom
  - System.Configuration.ConfigurationManager
  - System.Formats.Nrbf
  - System.IO.Hashing
  - System.Reflection.MetadataLoadContext
  - System.Resources.Extensions
  - System.Runtime.Serialization.Formatters
  - System.Text.Encodings.Web
  - System.Text.Json
  - System.Windows.Extensions

[marker]: <> (End:7442e8e7-a558-4305-8b1f-3fa7e892b4a1)


[1]: dotnet/dotnet@7ac1ca6...9eb0ecd

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/13845)
[2]: dotnet/dotnet@7ac1ca6...96384f4
[marker]: <> (Start:Footer:CodeFlow PR)

## Associated changes in source repos
-
dotnet/arcade@f2cdf94...7d2c2bb
-
dotnet/deployment-tools@0a1e836...c3b8848
-
dotnet/efcore@3aca835...7be8e74
-
dotnet/fsharp@e513690...226338e
-
dotnet/msbuild@35f09c0...0ae4996
-
NuGet/NuGet.Client@ef6cddc...24e1124
-
dotnet/razor@f2270a5...ce45cf4
-
dotnet/roslyn@5fc0475...a70b5c1
-
dotnet/runtime@4cf369e...81e8e84
-
dotnet/source-build-assets@810a5c5...25c18c2
-
microsoft/vstest@c8ffd9e...f7325aa

[marker]: <> (End:Footer:CodeFlow PR)
Updated Dependencies:
Microsoft.DotNet.Arcade.Sdk, Microsoft.DotNet.CMake.Sdk, Microsoft.DotNet.GenFacades, Microsoft.DotNet.Helix.Sdk, Microsoft.DotNet.RemoteExecutor, Microsoft.DotNet.XUnitV3Extensions (Version 10.0.0-beta.25454.107 -> 10.0.0-beta.25458.103)
Microsoft.NET.Sdk.IL, Microsoft.NETCore.App.Ref, Microsoft.NETCore.ILAsm, Microsoft.NETCore.ILDAsm, Microsoft.NETCore.Platforms, Microsoft.Win32.SystemEvents, runtime.win-x64.Microsoft.NETCore.ILAsm, System.CodeDom, System.Configuration.ConfigurationManager, System.Formats.Nrbf, System.IO.Hashing, System.Reflection.MetadataLoadContext, System.Resources.Extensions, System.Runtime.Serialization.Formatters, System.Text.Encodings.Web, System.Text.Json, System.Windows.Extensions, runtime.win-x86.Microsoft.NETCore.ILAsm (Version 10.0.0-rc.2.25454.107 -> 10.0.0-rc.2.25458.103)
> [!NOTE]
> This is a codeflow update. It may contain both source code changes
from [the VMR](https://github.com/dotnet/dotnet) as well as dependency
updates. Learn more
[here](https://github.com/dotnet/dotnet/tree/main/docs/Codeflow-PRs.md).

This pull request brings the following source code changes

[marker]: <> (Begin:7442e8e7-a558-4305-8b1f-3fa7e892b4a1)

## From https://github.com/dotnet/dotnet
- **Subscription**:
[7442e8e7-a558-4305-8b1f-3fa7e892b4a1](https://maestro.dot.net/subscriptions?search=7442e8e7-a558-4305-8b1f-3fa7e892b4a1)
- **Build**:
[20250908.3](https://dev.azure.com/dnceng/internal/_build/results?buildId=2788734)
([282379](https://maestro.dot.net/channel/5173/github:dotnet:dotnet/build/282379))
- **Date Produced**: September 8, 2025 10:00:59 PM UTC
- **Commit**:
[f7f9fbc789eaea36c447f3826eac66a925965915](dotnet/dotnet@f7f9fbc)
- **Commit Diff**:
[96384f4...f7f9fbc](dotnet/dotnet@96384f4...f7f9fbc)
- **Branch**:
[release/10.0.1xx](https://github.com/dotnet/dotnet/tree/release/10.0.1xx)

**Updated Dependencies**
- From [10.0.0-beta.25454.107 to 10.0.0-beta.25458.103][1]
  - Microsoft.DotNet.Arcade.Sdk
  - Microsoft.DotNet.CMake.Sdk
  - Microsoft.DotNet.GenFacades
  - Microsoft.DotNet.Helix.Sdk
  - Microsoft.DotNet.RemoteExecutor
  - Microsoft.DotNet.XUnitV3Extensions
- From [10.0.0-rc.2.25454.107 to 10.0.0-rc.2.25458.103][1]
  - Microsoft.NET.Sdk.IL
  - Microsoft.NETCore.App.Ref
  - Microsoft.NETCore.ILAsm
  - Microsoft.NETCore.ILDAsm
  - Microsoft.NETCore.Platforms
  - Microsoft.Win32.SystemEvents
  - runtime.win-x64.Microsoft.NETCore.ILAsm
  - runtime.win-x86.Microsoft.NETCore.ILAsm
  - System.CodeDom
  - System.Configuration.ConfigurationManager
  - System.Formats.Nrbf
  - System.IO.Hashing
  - System.Reflection.MetadataLoadContext
  - System.Resources.Extensions
  - System.Runtime.Serialization.Formatters
  - System.Text.Encodings.Web
  - System.Text.Json
  - System.Windows.Extensions

[marker]: <> (End:7442e8e7-a558-4305-8b1f-3fa7e892b4a1)

[1]: dotnet/dotnet@96384f4...f7f9fbc
[marker]: <> (Start:Footer:CodeFlow PR)

## Associated changes in source repos
-
dotnet/arcade@7d2c2bb...c831777
-
dotnet/diagnostics@a321e26...a853665
-
dotnet/efcore@7be8e74...87080da
-
dotnet/fsharp@226338e...1614065
-
dotnet/msbuild@0ae4996...0bc107d
-
dotnet/razor@ce45cf4...3b0d715
-
dotnet/runtime@81e8e84...6883bb2
-
dotnet/source-build-assets@25c18c2...c9ace1e

[marker]: <> (End:Footer:CodeFlow PR)
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/dotnet/winforms/pull/13851)
[release/10.0] Source code updates from dotnet/dotnet
[release/10.0] Source code updates from dotnet/dotnet
[release/10.0] Source code updates from dotnet/dotnet
[release/10.0] Source code updates from dotnet/dotnet
[release/10.0] Source code updates from dotnet/dotnet
[release/10.0] Source code updates from dotnet/dotnet
zuizuihao and others added 25 commits March 16, 2026 16:24
…tions from `src/System.Windows.Forms/src/Resources`
…es (Brazilian Portuguese, Russian, Turkish, Simplified Chinese, Traditional Chinese)
WI01041726 - Legacy Control Migration: Menu Stack
* Add System.Windows.Forms.Package project and update release workflow

- Introduced a new project for System.Windows.Forms.Package to restore legacy controls.
- Updated create-release.yml to reference the new package project.
- Removed outdated README.md and added a new one for the package.
- Cleaned up packageContent.targets and System.Windows.Forms.csproj for better dependency management.

* Add DataGrid demo surface and legacy DataGrid tests

Introduced a new DataGridForm demo accessible from MainForm, featuring classic DataGrid behaviors, appearance options, and navigation. Updated MainForm to launch the DataGrid demo. Added comprehensive unit tests for legacy DataGrid types (DataGrid, DataGridTableStyle, DataGridColumnStyle, GridColumnStylesCollection, GridTableStylesCollection, GridTablesFactory, DataGridCell, DataGridColumnHeaderAccessibleObject) covering constructors, properties, events, and integration scenarios. Supports migration and validation of legacy Windows Forms DataGrid components.

* Centralize warning suppression for legacy sources

Removed scattered #pragma warning disables from legacy files and moved suppression to .editorconfig and project files. Updated .editorconfig and .csproj files to suppress relevant code analysis and style warnings for demo, test, and compatibility sources, improving maintainability and clarifying intentional legacy patterns.

* Implement full DataGrid functionality and accessibility

Add complete implementations for DataGrid and related classes, replacing API stubs with working logic for cell/row editing, painting, layout, navigation, event handling, and accessibility. Introduce new internal classes for UI components (caption, parent rows, relationship rows, tooltips) and accessibility objects. Update resource and localization files for new features and descriptions. Enhance DataGridForm with advanced demo options and controls. Remove obsolete hit test types.

* Update version numbers in Versions.props and set VersionPrefix in System.Windows.Forms.Package.csproj

* Update packaging configuration to include versioning based on WtgPackageVersionPrefix

* Fix documentation status of DataGrid migration to reflect completion of porting
* Restore full legacy StatusBar control implementation

Replaced compatibility-only stubs with working StatusBar runtime, including panel collection, layout, simple-text mode, owner-draw, tooltips, and events. Deleted old throw-only StatusBarPanelCollection and nested real collection in StatusBar.cs. Synced all related panel/event types and enums with upstream docs. Restored StatusBar-specific SRDescription metadata and resource keys; updated all 13 locale XLF files with translation entries. Added StatusBarForm demo and launcher integration for manual validation. Introduced StatusBarTests for automated coverage. Updated migration docs and improved demo descriptions. StatusBar is now fully functional and ready for validation.

* Refactor legacy StatusBar documentation: update status, streamline file changes, and restore metadata parity
* Port and validate legacy ToolBar control family

Fully implement ToolBar, ToolBarButton, and related types, replacing stubs with upstream WinForms runtime code. Add a modern demo form (ToolBarForm) showcasing all button types, state management, and toolbar features. Integrate a comprehensive test suite for ToolBar and ToolBarButton, including advanced tooltip and DPI scenarios. Update launcher UI and migration docs, add string resources and translations, and introduce a compatibility shim for Win32 interop. This completes ToolBar migration and enables full runtime and designer support.

* Update MainForm layout; expand .editorconfig suppressions

Revamped MainForm to a two-column layout, adding a dedicated ToolBar section with new button and label. Adjusted control sizes, positions, and tab indices for consistency, and increased form height. Updated ToolBar label text for clarity. Removed pragma warning disables from several files, relying on expanded .editorconfig suppressions for code analysis and style warnings.

* Refactor ToolBar error handling: replace legacy error messages with SR resource strings
* WI00938771 Temporary fix for WebBrowser leak (dotnet#29)

Change WebBrowser references in WebBrowserSiteBase and WebBrowserEvent to a WeakReference.
Temporary fix while waiting for dotnet#13769

(cherry picked from commit 1ca4f6d)

* Add regression tests for PaintEventArgs.ResetGraphics FailFast crash and fix graphics state restoration  in PaintEventArgs (WI00857973)

* Implement Anchor Layout High-DPI Regression Fixes

- Added a new button in MainForm to demonstrate the AnchorLayoutHighDpiRegression.
- Refactored Program.cs to set the main method as private and removed unnecessary comments regarding high DPI settings.
- Introduced AnchorLayoutHighDpiRegressionTests to validate the behavior of bottom/right-anchored controls in high DPI scenarios.
- Created a detailed markdown document outlining the high-DPI regression issues and proposed solutions.
- Added compatibility logic in DefaultLayout.AnchorLayoutCompat.cs to handle stale positive anchors and stretch-anchor recovery.
- Updated DefaultLayout.cs to integrate the new compatibility checks for anchor information during layout calculations.

* patch UTs in WI00949199 Add HasMenu logic from .NET Core 3.0 Winforms (dotnet#33)
WI00949199 - form size should be recalculated when menu changes (dotnet#36)

* Throw on disposed parent/host instead of returning null

Updated Parent and Host property accessors to throw ObjectDisposedException when the underlying WeakReference target is unavailable, making disposal explicit and preventing null reference issues.

---------

Co-authored-by: Zehuan <zehuan.geng@wisetechglobal.com>
* Fix NRE in Control.Dispose(false) with ContextMenuStrip

Move ContextMenuStrip event unsubscription inside the disposing guard to prevent NullReferenceException during finalization. Add regression test and helper class to verify property is not accessed in Dispose(false). Update solution to include new projects and configurations.

* Update .NET setup in workflows to use global.json instead of dotnet-version

* Remove System.Windows.Forms.Tests project from solution
* Fix: ContextMenu submenus fire Popup on non-Form controls

WM_INITMENUPOPUP is now handled in Control to dispatch to ContextMenu.ProcessInitMenuPopup, ensuring MenuItem.Popup events fire for submenus shown from non-Form controls (e.g., DataGrid). This enables dynamic submenu population and fixes the issue where placeholder items were never replaced. The MenuStackForm demo is updated to use a DataGrid with dynamic submenus to visually repro the bug. Regression tests are added to verify correct Popup event firing for both direct and nested submenus.

* Add documentation for releasing a NuGet package using GitHub Actions
… bounds

Co-authored-by: Copilot copilot@github.com
… bounds

Co-authored-by: Copilot copilot@github.com
…ession

WI01079276 - Fix QI control regressions
…larity in BindingContext and RelatedCurrencyManager
… of parent change notifications in RelatedCurrencyManager
…ager.Net10Fix

WI01076374 - Currency Manager .NET10 Fix
…on CargoWise collections)

Replicate .NET Framework ZBindingContext.ParentCurrentChangedHandler empty-parent behavior
in the rewired CurrentChanged handler path. When parent manager has no current row (Count==0),
the child now binds an empty list (AllowNew=false) instead of calling AddNew(), which
materializes orphaned business objects whose SetDefaultsForNewChild/property getters
dereference null parent navigations.

Changes:
- RewireParentChangeHandler now wires parent CurrentChanged to new ParentManager_CurrentChanged
- ParentManager_CurrentChanged: empty parent → SetDataSource(empty BindingList) + listposition=-1
  + raise position/current events; non-empty → delegate to stock ParentManager_CurrentItemChanged
- Stock ParentManager_CurrentItemChanged: one-line guard change (LV1 WI01086017):
  else if (currencyManager.List is IBindingList { AllowNew: true }) — skips AddNew on read-only lists

The recursive EnsureListManager ordering (parent registered+rewired before child ctor-primes)
ensures the guard+placeholder also protect the constructor-time priming AddNew.

Validated: DE ExitSummaryPlugInTest.TestBashUserControlOfPlugIn = PASS (was NRE);
MM GlbCompanyCampaignFormTest.TestBashingForm = NRE eliminated (0 signatures in TRX).
Earlier broad run cleared NRE in 23/23 across 11 assemblies.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@FahmiFuzi FahmiFuzi requested a review from a team as a code owner June 11, 2026 04:19
@FahmiFuzi

Copy link
Copy Markdown
Author

Wrong repo — closing and recreating in WiseTechGlobal/winforms

@FahmiFuzi FahmiFuzi closed this Jun 11, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

@FahmiFuzi please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@dotnet-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@dotnet-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@dotnet-policy-service agree company="Microsoft"
Contributor License Agreement

Contribution License Agreement

This Contribution License Agreement ( “Agreement” ) is agreed to by the party signing below ( “You” ),
and conveys certain license rights to the .NET Foundation ( “.NET Foundation” ) for Your contributions to
.NET Foundation open source projects. This Agreement is effective as of the latest signature date below.

1. Definitions.

“Code” means the computer software code, whether in human-readable or machine-executable form,
that is delivered by You to .NET Foundation under this Agreement.

“Project” means any of the projects owned or managed by .NET Foundation and offered under a license
approved by the Open Source Initiative (www.opensource.org).

“Submit” is the act of uploading, submitting, transmitting, or distributing code or other content to any
Project, including but not limited to communication on electronic mailing lists, source code control
systems, and issue tracking systems that are managed by, or on behalf of, the Project for the purpose of
discussing and improving that Project, but excluding communication that is conspicuously marked or
otherwise designated in writing by You as “Not a Submission.”

“Submission” means the Code and any other copyrightable material Submitted by You, including any
associated comments and documentation.

2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any
Project. This Agreement covers any and all Submissions that You, now or in the future (except as
described in Section 4 below), Submit to any Project.

3. Originality of Work. You represent that each of Your Submissions is entirely Your
original work. Should You wish to Submit materials that are not Your original work,
You may Submit them separately to the Project if You (a) retain all copyright and
license information that was in the materials as you received them, (b) in the
description accompanying your Submission, include the phrase "Submission
containing materials of a third party:" followed by the names of the third party and any
licenses or other restrictions of which You are aware, and (c) follow any other
instructions in the Project's written guidelines concerning Submissions.

4. Your Employer. References to “employer” in this Agreement include Your employer or anyone else
for whom You are acting in making Your Submission, e.g. as a contractor, vendor, or agent. If Your
Submission is made in the course of Your work for an employer or Your employer has intellectual
property rights in Your Submission by contract or applicable law, You must secure permission from Your
employer to make the Submission before signing this Agreement. In that case, the term “You” in this
Agreement will refer to You and the employer collectively. If You change employers in the future and
desire to Submit additional Submissions for the new employer, then You agree to sign a new Agreement
and secure permission from the new employer before Submitting those Submissions.

5. Licenses.

a. Copyright License. You grant .NET Foundation, and those who receive the Submission directly
or indirectly from .NET Foundation, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable
license in the Submission to reproduce, prepare derivative works of, publicly display, publicly perform,
and distribute the Submission and such derivative works, and to sublicense any or all of the foregoing
rights to third parties.

b. Patent License. You grant .NET Foundation, and those who receive the Submission directly or
indirectly from .NET Foundation, a perpetual, worldwide, non-exclusive, royalty-free, irrevocable license
under Your patent claims that are necessarily infringed by the Submission or the combination of the
Submission with the Project to which it was Submitted to make, have made, use, offer to sell, sell and
import or otherwise dispose of the Submission alone or with the Project.

c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement.
No additional licenses or rights whatsoever (including, without limitation, any implied licenses) are
granted by implication, exhaustion, estoppel or otherwise.

6. Representations and Warranties. You represent that You are legally entitled to grant the above
licenses. You represent that each of Your Submissions is entirely Your original work (except as You may
have disclosed under Section 3 ). You represent that You have secured permission from Your employer to
make the Submission in cases where Your Submission is made in the course of Your work for Your
employer or Your employer has intellectual property rights in Your Submission by contract or applicable
law. If You are signing this Agreement on behalf of Your employer, You represent and warrant that You
have the necessary authority to bind the listed employer to the obligations contained in this Agreement.
You are not expected to provide support for Your Submission, unless You choose to do so. UNLESS
REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING, AND EXCEPT FOR THE WARRANTIES
EXPRESSLY STATED IN SECTIONS 3, 4, AND 6 , THE SUBMISSION PROVIDED UNDER THIS AGREEMENT IS
PROVIDED WITHOUT WARRANTY OF ANY KIND, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTY OF
NONINFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.

7. Notice to .NET Foundation. You agree to notify .NET Foundation in writing of any facts or
circumstances of which You later become aware that would make Your representations in this
Agreement inaccurate in any respect.

8. Information about Submissions. You agree that contributions to Projects and information about
contributions may be maintained indefinitely and disclosed publicly, including Your name and other
information that You submit with Your Submission.

9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the State of Washington, and
the parties consent to exclusive jurisdiction and venue in the federal courts sitting in King County,
Washington, unless no federal subject matter jurisdiction exists, in which case the parties consent to
exclusive jurisdiction and venue in the Superior Court of King County, Washington. The parties waive all
defenses of lack of personal jurisdiction and forum non-conveniens.

10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and
supersedes any and all prior agreements, understandings or communications, written or oral, between
the parties relating to the subject matter hereof. This Agreement may be assigned by .NET Foundation.

.NET Foundation dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1.

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.