xaml mvvm efcore IOC

PharmaSoft 1 Reputation point


In IOC, I have this exemple in the modelview

public ReqCaisse(IDataContext database)
    dataBase = database;

and from the view, it creates a new modelview

    <b:EventTrigger EventName="Loaded">
        <b:CallMethodAction MethodName="LoadView" TargetObject="{StaticResource ResourceKey=CaisseRows}" />

so I have to put then static property for dataBase public static IDataContext dataBase;

Could you tell me how I can do it without using the static ? I know it is not from devexpress tools but i could help me if you give me somme infos I had this page https://community.devexpress.com/blogs/wpf/archive/2022/02/07/dependency-injection-in-a-wpf-mvvm-application.aspx but not enough infos for me Thanks a lot

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
583 questions
Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,475 questions
{count} votes