I'm trying to create a kind of master/detail UI using an MVP pattern. I have the usual suspects:
interface IMainView{}
class MainView: Form, IMainView{}
interface IMainPresenter{}
class MainPresenter{}
// Numerous domain objects
I also have a UserControl which is also a View of its own MVP triad:
interface ISubView{}
class SubView: UserControl, ISubView{}
interface ISubPresenter{}
class SubPresenter{}
The MainPresenter creates and instance of the SubPresenter, which in turn, creates an instance of SubView. My problem is the Views don't contain references to each other or even know each other exist. They only know about their own presenters but I want to attach one view that is a UserControl to another view that is a Form. Is this possible to do and still maintain each view's ignorance of each other?
Up until this point all the views have exposed the properties needed by each presenter as system types so the presenters would not be affected if a ListBox changed to a ComboBox or a RadioGroup. I'd like to keep it this way if possible but I'm willing to break this pattern if I have no other choice.
My reasons for doing this is the MainView presents the user with a collection of objects. Each object can be one of several (more than 50) different classes. All will implement a common interface but the UI for manipulating each object will vary with the underlying class.
By the way, this is a Winforms application targeting .NET 2.0 (it's compiled as C# 3.0 though)