L
L
legati2014-10-24 13:21:15
.NET
legati, 2014-10-24 13:21:15

WPF: how to properly insert a view into another view with dependency di initializations?

Child view has a view constructor

View1(IViewModel model)
{
      DataContext=model;
      InitializeComponent();
}

How can I insert this view into another view through the markup so that the unity di-container itself resolves all dependencies?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aush, 2014-10-24
@legati

Constructors with parameters have x:Arguments and x:FactoryMethod attributes . But unity won't help here.
There is such an option for using a container - dotnetninja.wordpress.com/2010/02/23/ioc-inversion... , but keep in mind that here the container is used as a Service Locator .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question