Skip to content

System.NullReferenceException: Object reference not set to an instance of an object. #12

@psudodev

Description

@psudodev

{System.NullReferenceException: Object reference not set to an instance of an object.
at FreshMvvm.Maui.FreshPageModelResolver.ResolvePageModel[ProcessAuditPopupViewModel](Object data, ProcessAuditPopupViewModel pageModel)

at

I am using Mopups in My Maui project with Freshmvvm.Maui

 public static Task PushPopup<T>(this IPageModelCoreMethods coreMethods, object data = null) where T : FreshBasePageModel
    {

        T pageModel = DependencyService.Resolve<T>();
        var page = FreshPageModelResolver.ResolvePageModel(data, pageModel) as PopupPage;
        return MopupService.Instance.PushAsync(page);
    }
    
    as mentioned in the Blog TinyIOC has been removed and by default we use the Microsoft default dependency injection. The biggest advantage of this is you can bring in any container that supports the Microsoft Dependency Injection.

I might be missing the obvious here but It fails to Inject the DependecyService

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions