BurkusCat / Burkus.Mvvm.Maui

A simple MVVM framework for .NET MAUI. It provides: navigation, lifecycle events, parameter passing, native dialog abstractions, and testability.
MIT License
27 stars 5 forks source link

[Feature] Builder .OnStart should allow for any dependency to be resolved #15

Closed BurkusCat closed 11 months ago

BurkusCat commented 1 year ago

Is your feature request related to a problem? Please describe. The current builder .OnStart method allows you to use INavigationService to choose your startup page. You can use ServiceResolver to resolve a service to do more complicated logic but this makes your code less testable.

Describe the solution you'd like A new overload for .OnStart that allows IServiceProvider to be provided.

Describe alternatives you've considered ServiceResolver can be used but it is not as test friendly.

Proposed APIs If possible, try to propose how the API might look. For example:

// BurkusMvvmBuilderExtensions
public static BurkusMvvmBuilder OnStart(this BurkusMvvmBuilder builder, Func<INavigationService, IServiceProvider, Task> onStartFunc)

Additional context N/A