Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.
Your profile
Tag cloud
.net .net 3.5 .net 4.0 2003 access modifiers beginners book buildup c# excel f# linq microsoft reporting engine nhibernate nhprof nunit programming reflection reportviewer resharper rhino mocks structuremap threading unit testing vb.net vb.net. visual studio 2010 windows forms windows presentation foundation wpf
Authors
- chrissie1 (122)

- SQLDenis (17)

- Alex Ullrich (8)

- chaospandion (4)

- George Mastros (1)

- chopstik (1)

- tarwn (1)

- remou (1)

- More...
Main Categories
Search
Google Ads
Tags: buildup
For my usercontrols I tend to use the StructureMap BuildUp feature. I will leave it to the big man himself to introduce you to this feature.
I use property injection in this case because the designer doesn't like usercontrols that have constructors that are not empty, since it will try to execute the code in that constructor. So we revert to property injection and the BuildUp feature....
In my previous post I already mentioned the BuildUp method in StructureMap and how cool that can be. And now I want to show you how to do this in VB.Net. As we all know VB.Net doesn't like Multiline lambdas or void lambdas. But we will kill somebody for that later. In this example I also used a real form and it didn't get hurt by the designer this time.
The code is pretty much the same as my previous post.
Here are the services and their interfaces.
And it just got cooler. After I read this "BuildUp" Existing Objects with StructureMap I got an aha moment. The BuildUp function that was recently added just solved my very ugle winforms usercontrol problem. I use to have to add objectfactory.getinstance code in the constructors to get my dependencies just to keep the designer happy. I hate to design winforms without the designer but the designer hates me. But now this love hate relationship has bcome a little...


LTD Social Sitings
Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.