Thursday, April 4, 2019

How would you manage a single model class dependency so that it's easily accessible, and properly managed across the application?

We have a working solution, but I have low knowledge on ninject, and others, and I'm curious if there are more efficient ways to handle this, so I'm fishing for ideas.

Use case:
I need an desktop application that can search for customers by specific input data.

When a customer is found, a pivot item is created specifically for the customer, and contains many views that are dependent on the customer. (Can have different pivot items containing their own instance of a customer )

Currently our main page inherits a base class that holds a dependency property for the customer which is set initially when the customer information is gathered at the first search.

We then pass the dependency property through via constructor injection. to each view/view model.

Each view inherits the same base class, so the customer object is set in each constructor of each view/view model as they are created.

The view model does not inherit from the base class, but expects a customer type parameter in the constructor. It then sets the view model property of the customer type to the parameter passed through.

Additional information:

Universal Windows Application is what we're building. I don't think this is a must know for my question but just in case, fyi.

How would you manage a single model class dependency so that it's easily accessible, and properly managed across the application? Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team