Skip to content

ONLY FOR TESTING: Integration-3 for the new .NET 11 API#14768

Draft
KlausLoeffelmann wants to merge 99 commits into
dotnet:mainfrom
KlausLoeffelmann:Net11/Integration-3
Draft

ONLY FOR TESTING: Integration-3 for the new .NET 11 API#14768
KlausLoeffelmann wants to merge 99 commits into
dotnet:mainfrom
KlausLoeffelmann:Net11/Integration-3

Conversation

@KlausLoeffelmann

@KlausLoeffelmann KlausLoeffelmann commented Jul 18, 2026

Copy link
Copy Markdown
Member

This branch is for integration testing only and must not be merged.

Component PRs: #14733, #14734, #14735, #14736, #14737
SystemVisualSettings proposal: KlausLoeffelmann#14

It combines the independently reviewed Net11 API branches B00 through B05 and adds the
cross-feature composition for:

  • SystemVisualSettings
  • VisualStylesMode change-impact dispatch
  • High Contrast routing
  • accent-aware rendering
  • client-area animation policy
  • TextBox focus metrics and text scale
  • the high-resolution animation pacer

The PR remains a draft validation surface for the complete .NET 11 API set.

The full CI matrix passes for Windows x86/x64/ARM64 in Debug and Release.

Microsoft Reviewers: Open in CodeFlow

KlausLoeffelmann and others added 10 commits July 18, 2026 01:26
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 27022e2a-9eb8-4f58-9bfa-e79ca0d6c559
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hand-author the IUISettings3 / UIColor / UIColorType WinRT ABI types and generate the RoActivateInstance / WindowsCreateString / WindowsDeleteString / IInspectable / HSTRING Win32 bindings via CsWin32. The WinRT ABI types are excluded from the .NET Framework build, which does not consume them.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose the user's current Windows accent color by activating the Windows.UI.ViewManagement.UISettings runtime component and reading UIColorType.Accent. When no accent color is set, Windows returns an OS-defined default, so the method always yields a usable color.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use event subscriptions as the opt-in for text-size notifications and
remove the redundant awareness API surface.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 40d0f0f7-a584-4167-9187-9d529b7c70f8
Wrap the Form event remark in a paragraph and remove the redundant
nullable handler initialization reported by the Arcade analyzers.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 40d0f0f7-a584-4167-9187-9d529b7c70f8
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 27022e2a-9eb8-4f58-9bfa-e79ca0d6c559
KlausLoeffelmann and others added 10 commits July 19, 2026 23:43
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 20883488-cf1e-4ad3-a681-0724e9f16777
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Implements suspend painting and relocation scopes, deferred child positioning, and form appearance mode infrastructure for .NET 11.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…rface

Splits DeferLocationChange out of this branch entirely (postponed pending an
anchor-layout-engine integration fix; tracked separately in
#12) and reworks ISupportSuspendPainting /
ISupportSuspendRelocation on Control to match the final API shape agreed in
dotnet#14585:

- Control implements ISupportSuspendPainting/ISupportSuspendRelocation via
  explicit interface implementation instead of public virtual methods, so the
  manual Begin/End pair does not become the primary IntelliSense surface on
  every Control-derived type. Protected virtual BeginSuspendPaintingCore() /
  EndSuspendPaintingCore() / BeginSuspendRelocationCore() /
  EndSuspendRelocationCore() are the new override points.
- ListView, ListBox, ComboBox, TreeView, RichTextBox override the ...Core()
  hooks instead of the old public virtual methods, still routing through
  their existing BeginUpdate/EndUpdate.
- SuspendPaintingScope and SuspendRelocationScope change from
  readonly ref struct to sealed class : IDisposable, so the scope can span an
  await in an asynchronous UI event handler (a ref struct cannot be hoisted
  into an async state machine - this was the flagship usage scenario in the
  original API proposal, and it did not compile against the ref struct
  version). Dispose is idempotent.
- Deletes DeferLocationChangeScope.cs and the Control.DeferLocationChange
  overloads entirely.
- Updates/removes tests accordingly; updates PublicAPI.Unshipped.txt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…inel

Matches the final API shape agreed in dotnet#14585:

- FormAppearanceMode -> FormRevealMode, adding Inherit = -1 as the ambient
  sentinel (Classic stays the CLR default value 0, matching the
  RightToLeft.Inherit / VisualStylesMode.Inherit precedent for ambient
  enums - the sentinel is a distinct value, not the zero value, so
  default(FormRevealMode) stays conservative).
- Form.FormRevealMode is now a real public virtual, PropertyStore-backed,
  [AmbientValue(Inherit)] property (previously there was no per-Form
  property at all - only the flat, process-wide
  Application.FormAppearanceMode existed). This lets a form such as a splash
  screen opt itself out of deferred reveal without touching the process-wide
  default. Resolution is flat (Form only, no Control-parent-chain): DWM
  cloaking only ever applies to top-level, non-MDI-child windows, so there is
  no hierarchy to walk, unlike VisualStylesMode's genuine control-nesting
  cascade.
- Application.FormAppearanceMode / SetFormAppearanceMode are replaced by
  three members: DefaultFormRevealMode (get; may return the unresolved
  Inherit sentinel, mirroring ColorMode returning the unresolved System
  value), SetDefaultFormRevealMode (freely reassignable, unlike the
  write-once SetDefaultVisualStylesMode - the effective default is derived in
  part from ColorMode/IsDarkModeEnabled, which are themselves mutable for the
  life of the process), and IsFormRevealDeferred (bool; the fully resolved
  answer: Deferred, or Inherit + IsDarkModeEnabled). This also fixes a
  compatibility problem in the original design: the old default was
  unconditionally Deferred whenever SetFormAppearanceMode was never called,
  an opt-out behavior change for every existing app; tying the Inherit
  resolution to dark mode means an app that never touches SystemColorMode
  sees no behavior change, while the scenario the feature exists for
  (dark-mode startup flash) is fixed by default.
- ShouldUseDeferredAppearanceCloak now reads the resolved Form.FormRevealMode
  instead of the old flat Application-only check, so a per-Form override is
  actually honored.
- Adds SR.resx/xlf entries for the new property's designer description.
- Updates/adds tests; updates PublicAPI.Unshipped.txt.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds Microsoft.VisualBasic.ApplicationServices.ApplyApplicationDefaultsEventArgs.FormRevealMode,
following the exact same pattern already established for ColorMode and
HighDpiMode in that class, per dotnet#14585's API Proposal.

WindowsFormsApplicationBase now carries a _formRevealMode shadow field
(defaulting to FormRevealMode.Classic, matching the existing conservative
default for _colorMode) and a protected FormRevealMode property, feeds it
into the ApplyApplicationDefaultsEventArgs constructor alongside
MinimumSplashScreenDisplayTime/HighDpiMode/ColorMode, reads back whatever the
ApplyApplicationDefaults event handler set, and calls
Application.SetDefaultFormRevealMode(_formRevealMode) at the end of
OnInitialize alongside the existing Application.SetColorMode(_colorMode)
call.

This completes work anticipated but never finished in an earlier .NET 9
Visual Styles attempt at this same VB Application Framework extension point
(OnInitialize already carried a comment claiming "We feed the defaults for
HighDpiMode, ColorMode, VisualStylesMode to the EventArgs", but only
HighDpiMode/ColorMode were ever actually wired up).

Updates PublicAPI.Unshipped.txt for Microsoft.VisualBasic.Forms.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply disabled-text contrast to explicit foreground colors, paint rounded Classic popup corners over the real parent surface, and clip BackgroundImage content inside popup chrome and renderer content bounds.

Follow-up for dotnet#14753 and dotnet#14760

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c352332b-4b81-4492-bcfc-9dec524c27c9
Reapply explicit fullscreen bounds when display geometry or the taskbar working area changes so the normal-state kiosk window tracks the selected screen like the previous maximized window did.

Fixes dotnet#14765

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: c352332b-4b81-4492-bcfc-9dec524c27c9
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Move modern TextBox and UpDown chrome constants into a shared internal source so subsequent renderers use one DPI-independent metric family.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Add mode-gated card, outline, and header-band renderers with shared layout metrics, cached scaled captions, text-scale relayout, and effective-mode UIA heading semantics. Keep FlatStyle.System native.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Route Net11 Standard, Flat, and Popup styles through a DPI-aware WinForms adapter, share TextBox field metrics, align native selection heights, and round Win11 dropdowns while preserving System and High Contrast paths.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Keep modern toggle switches owner-drawn when FlatStyle.System is selected and use control bounds instead of requesting an unsupported native adapter. Cover every FlatStyle, Appearance, and VisualStylesMode interaction.

Fixes dotnet#14754

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Base ShouldSerializeVisualStylesMode on the raw PropertyStore entry so Inherit emits no CodeDOM while explicit values round-trip through designer serialization.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Move affected property contracts into partial declarations and add adaptive-layout guidance for metric growth, fixed-bounds editors, GroupBox content geometry, and aligned TextBox/ComboBox rows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Apply native selection-field height overrides only while modern metrics are active, or while restoring a field that previously used them, so classic owner-drawn item bounds remain unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Assert the fixed non-owner-drawn mouse-over geometry instead of retaining the previous unsupported-adapter exception expectation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Render Standard as a borderless rectangular surface, use an accent outline for Flat and an accent header for Popup, and select real installed Semibold faces without mutating ambient fonts. Align caption and content metrics with Padding and preserve the existing visual-settings tracker cleanup.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Reactivate designer serialization for the shipped Padding property, add a one-pixel framework inset, render rounded Standard and Popup frames plus a square Flat frame, and keep native edit/list content aligned across DPI, style, and layout changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Accept the native System-style handle recreation's platform-dependent zero-or-one invalidation while retaining exact expectations for owner-drawn styles.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
Reintroduce the consolidated accessibility text-scale helper dropped during Integration-3 replay so SystemVisualSettingsTracker and font scaling share one registry implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 24d81626-c337-40c8-a515-393ee8e9827d
break;

case AnimationCycle.Bounce:
item.FrameOffset = -item.FrameOffset;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 item.FrameCount  is only ever written, never read, and  item.FrameOffset  only feeds  FrameCount  — neither value is consumed by any rendering/progress logic ( progress  is derived purely from timestamps). As a result the  Loop  and  Bounce  branches perform the same effective work (reset  TargetTimestamp  +  RestartAnimation() ), so  Bounce  currently behaves identically to  Loop  and the "reverse direction" semantics are not implemented. On top of that,  RestartAnimation()  rebuilds the  AnimationRendererItem , so the  FrameOffset  negation doesn't persist across cycles anyway. Is  Bounce  intended to be implemented later (i.e. these fields are placeholders), or can we drop  FrameCount FrameOffset  and have  Bounce  fall back to the  Loop  path for now?

public float NodeLeading
{
get => Properties.GetValueOrDefault(s_nodeLeadingProperty, 0.0f);
set

@SimonZhao888 SimonZhao888 Jul 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If NodeLeading is assigned a value greater than 0 but less than 1, the nodes in the TreeView become overly crowded, and overlapping issues occur. Should we round values ​​within this range to avoid unexpected layout results?
Corresponding issue: #14791

ShouldUseDeferredAppearanceCloak() gated the DWM cloak on Visible == true, but it is only evaluated from OnHandleCreated, where a top-level form's window is still hidden (WS_VISIBLE is cleared from the create params and the show is deferred). The Visible state bit is not set until WM_SHOWWINDOW is processed, so the guard was always false, the cloak never engaged, and the window was shown uncloaked - still producing the default-background flash the mode is meant to prevent.

Remove the Visible term so the already-hidden window is cloaked at handle creation. This covers Show, ShowDialog (which creates the handle via CreateControl before showing) and handle recreation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

draft draft PR 🚫 * NO-MERGE * The PR is not ready for merge yet (see discussion for detailed reasons)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants