xaml mvvm efcore IOC

PharmaSoft 1 Reputation point
2023-09-06T09:24:07.0733333+00:00

Hello

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:Interaction.Triggers>
    <b:EventTrigger EventName="Loaded">
        <b:CallMethodAction MethodName="LoadView" TargetObject="{StaticResource ResourceKey=CaisseRows}" />
    </b:EventTrigger>
</b:Interaction.Triggers>

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

Developer technologies | .NET | Entity Framework Core
Developer technologies | Windows Presentation Foundation
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.