PrismLibrary / Prism

Prism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, Xamarin Forms, and Uno / Win UI Applications..
Other
6.36k stars 1.64k forks source link

[BUG] Injection IContainerProvider #3280

Open Vunda opened 4 days ago

Vunda commented 4 days ago

Description

Cannot inject IContainerProvider to custom services. container doesn't see registered pages. Tested Prism version 9.0.537 Dotnet sdk 8.0.404

It is very strange but container in App.xaml.cs works fine. and constructor of custom service invoked after App constructor. It is mean that container was already builded.

Attached tested project

PrismContainer.zip

Steps to Reproduce

  1. Create maui template app.
  2. Instal Prism.DryIoc.Maui
  3. Create CustomService with IContainerProvider as argument in constructor.
  4. Add CustomPage for tests.
  5. Inject IContainerProvider in App.xaml.cs.
  6. Inject CustomService in CustomPage.
  7. Check if the container in custom service has registered pages...

Platform with bug

.NET MAUI

Affected platforms

iOS, Android

Did you find any workaround?

No response

Relevant log output

No response

Vunda commented 4 days ago

sorry forget to write. I tested on iOS simulator.