OB with Winforms

Jan 26, 2007 at 10:53 PM
I can't seem to get OB to work with Winforms. I'm successfully using it in a WCSF web application, but if I have a simple form with the following:

CreateNew
public ManageAdminFoldersPresenter Presenter
{
get
{
return _presenter;
}
set
{
_presenter = value;
_presenter.View = this;
}
}

the property never gets set and hence my _presenter is always null. Does the CreateNew attribute not work the same in a Winform application as it does in a web application?

Thanks,

Trevor de Koekkoek
Mar 5, 2007 at 8:31 PM
Trevor,

The WCSF has a wonderful application block called the Composite Web Application Block that is using ObjectBuilder behind the scenes to do dependency injection that you don't get from a normal winform client.

For winform applications, you will want to look at the Composite UI Application Block which provides similar functionality in winform applications:

http://www.codeplex.com/smartclient

Regards,

Dave

_____________________

David Hayden
Microsoft MVP C#