Skip to content

[Application Builder] Enable Designer-safe dependency injection and UI scopes #14947

Description

@KlausLoeffelmann

User story

As a WinForms developer, I want Forms, UserControls, and components to participate in dependency injection and well-defined UI scopes without breaking drag-and-drop Designer workflows.

Rationale and user benefit

Constructor injection conflicts with parameterless design-time creation. Static service locators hide lifetime errors and make testing harder. A supported bridge must keep the out-of-process Designer, generated code, runtime activation, disposal, and scope ownership coherent.

Scope boundary

Own Designer/runtime service assignment, activation and factory contracts, Form/UserControl/component scopes, disposal, and scope-aware navigation. Depend only on the minimum host contracts from the lifetime story. Do not own configuration providers, logging providers, or project templates.

Acceptance criteria

  • Drag-and-drop and generated Designer code continue to work.
  • Runtime-created Forms and controls can resolve required services without a global static provider.
  • Scope ownership and disposal are deterministic for Forms, modal dialogs, UserControls, and application contexts.
  • Design-time service absence is explicit and does not leak into runtime behavior.
  • Existing controls and components require no migration.
  • Out-of-process Designer requirements are agreed with the Designer team.

Definition of Done

  • Public and Designer contracts are reviewed together.
  • Runtime and Designer implementations, tests, samples, and migration guidance are complete.
  • Disposal, nested scopes, exception paths, design-time detection, memory, and handle stability are validated.

Parallelization

This is foundation stream B. Keep Designer/code-generation changes isolated from stream A's lifetime implementation and stream C's service integrations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Review IssueIssue content and decomposition require team review and may be iterated

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions