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

Entity Framework Core
Entity Framework Core
A lightweight, extensible, open-source, and cross-platform version of the Entity Framework data access technology.
732 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,760 questions
{count} votes

Your answer

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