Click here to Skip to main content
13,447,272 members (38,851 online)
Click here to Skip to main content


42 bookmarked
Posted 1 Jan 2009

Model View Presenter with WPF and Unity Container

, 1 Jan 2009
This article demonstrates using a model view presenter (MVP) pattern in a sample program.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;
using System.Configuration;
using System.ComponentModel;

namespace CustomerInfoObserver
    public class ContainerAccessor
        private static UnityContainer _container;
        public ContainerAccessor()
            if (_container == null)
                _container = new UnityContainer();

                //---Runtime Type binding - Read the Type mappings from unity container section from configuration file.
                UnityConfigurationSection section = (UnityConfigurationSection)ConfigurationManager.GetSection("unity");


        public UnityContainer GetContainer()
            return _container;

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

suraj mehare
India India
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180318.3 | Last Updated 1 Jan 2009
Article Copyright 2009 by suraj mehare
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid