G
Guest
In order to become more familiar with the Model-View-Controller pattern, I
have written a demo where each View is a plugin and the plugins are loaded at
startup from the plugins directory. When the View's are loaded they add
themselves to the DataModel View list...
FDataModel.AddView(this);
Where AddView looks like this...
public void AddView( MvcView view )
{
ViewChanged += new ViewChangedHandler(view.DataModified);
}
and at the right time I invoke the event list via...
ViewChanged(this, e);
This all works fine as long as I only have 1 instance of each type of view.
So in this case I have a Pie Chart View and Bar Chart view of the data ( as
well as the usual DataGrid view all as plugins ). Then the delegates
correctly fire and everything works as advertised. The problem arises if I
instantiate a second instance of say the Bar Chart. When that happens the
first Bar Chart stops responding/refreshing while the second Bar Chart
updates correctly.
Can any C# pattern gurus shed some light on what I might have overlooked?
have written a demo where each View is a plugin and the plugins are loaded at
startup from the plugins directory. When the View's are loaded they add
themselves to the DataModel View list...
FDataModel.AddView(this);
Where AddView looks like this...
public void AddView( MvcView view )
{
ViewChanged += new ViewChangedHandler(view.DataModified);
}
and at the right time I invoke the event list via...
ViewChanged(this, e);
This all works fine as long as I only have 1 instance of each type of view.
So in this case I have a Pie Chart View and Bar Chart view of the data ( as
well as the usual DataGrid view all as plugins ). Then the delegates
correctly fire and everything works as advertised. The problem arises if I
instantiate a second instance of say the Bar Chart. When that happens the
first Bar Chart stops responding/refreshing while the second Bar Chart
updates correctly.
Can any C# pattern gurus shed some light on what I might have overlooked?