dotnet / dotnet/wpf

Enable WPF to play well with Dependency Injection

Open
#6,434 2 comments 3 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

I created my own framework to use Dependency Injection in WPF. This is done using the ASP.NET infrastructure.
I can inject pages, viewmodels and many other types, but the WPF infrastructure does not allow to inject, for example, converters or markup extensions.

Markup extensions provide an IServiceProvider which we can't access elsewhere.

This issue is about a two-phase request:
- Step 1 (short-term): Ability to provide to WPF a user-provided IServiceProvider, so that I can retrieve my objects within a markup extension.
- Step 2 (long-term): Embrace the ASP.NET DI infrastructure so that we can access configurations within converters, controls, behaviors, etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.