This project is read-only.

Injecting a view into a view

Jun 30, 2014 at 6:10 PM
Hello,

I am trying to inject a CODE view into another CODE view.. to compose a more complex view...

normally I would do something like:
<local:NameofView />

and it would be pulled in... but the views in CODE do not have the codebehind... I know I can use a regular usercontrol, but was wondering if there is a way to inject a view based on an <mvvm:View> type of view...

Thanks
Harold
Jul 1, 2014 at 1:36 PM
Hello Harold,
Actually there is a way include CODE Views inside another CODE View. Following the MVC vernacular it is called Partial Views. There are several ways this can be done, but the simplest is:
<Mvvm:PartialView Controller="Customer" View="CustomerName" />
You can read more about Partial Views in the article located here:
https://codeframework.codeplex.com/wikipage?title=Partial%20Views%20in%20CODE%20Framework%20WPF

Jeff
Jul 1, 2014 at 5:44 PM
this is exactly what i was looking for! Knew it have to be in there... this has been an awesome framework to work in.


Thanks very much.
Harold