fix: support .NET Core in winforms activation design mode check#4358
Merged
glennawatson merged 3 commits intoMay 17, 2026
Conversation
* Delay the check. Controls are not yet sited while their constructor is running. * Use Control.IsAncestorSiteInDesignMode to support arbitrarily deeply nested controls.
Contributor
|
Might be about a week before we release btw. Just waiting on validation of a new code signing certificate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce?
Control.IsAncestorSiteInDesignMode(polyfilled on older targets) to support deeply nested controls.LicenseManager.UsageModecheck because it doesn't work on .NET Core and is no longer needed on .NET Framework after the other fixes.Form.What is the current behavior?
Design mode detection is broken on .NET Core.
The detection is done too early. Controls are not yet sited in their constructor, so
control.Site?.DesignModeis never true.LicenseManageris not supported on .NET Core.LicenseManager.UsageMode == LicenseUsageMode.Designtimeis always false.Design mode detection does not support deeply nested controls.
Only the current control and its parent are checked for design mode.
What is the new behavior?
Design mode detection works both on .NET Framework and .NET Core and supports deeply nested controls.
What might this PR break?
This shouldn't change anything at runtime, only design time.
Checklist
mainbranchAdditional information
Manually tested on
net481andnet10.0-windows10.0.19041.0.There are still more issues with the Winforms Designer.
Unless you inherit your controls from a base class that ensures ReactiveUI is initialized in its constructor,
WhenActivatedfails to resolveIActivationForViewFetcher.I don't know how to fix this in a way that can be upstreamed.