-
-
Notifications
You must be signed in to change notification settings - Fork 11
Dependency Injection
Simnico99 edited this page Mar 24, 2025
·
4 revisions
You will need to install the MicaWPF.DependencyInjection NuGet Package.
- Download via the Nuget package manager or use the NuGet Command line.
Install-Package MicaWPF.DependencyInjection
- If you have used the NuGet Command line restore the packages.
nuget restore ProjectName.sln
It is easy to implement just add .UseMicaWPF() to your IHostBuilder.
//Without Options
var builder = new HostBuilder();
builder.UseMicaWPF();
//With Options
var builder = new HostBuilder();
builder.UseMicaWPF(options =>
{
options.AccentColor = Color.FromArgb(1, 255, 100, 100);
options.Theme = WindowsTheme.Dark;
});It allows you to access the IThemeService and IAccentService from dependency injection.
See how to change theme or accent color.
The documentation is maintained by @Simnico99. This Library is distributed under an MIT License.