Ciaran,
That indeed seems to be a solution. The reason I was passing MainClass
to the ctr of SubClass1Indexer is because samples from MSDN and
CodeProject both did it this way. See here:
http://msdn.microsoft.com/library/de...esTutorial.asp
Class WordCollection is the indexer and it's constructor takes the
parent class Document. MSDN says: "For each "indexed property," you
define a nested class, which contains a reference back to the main
class instance."
Is there a reason why most people do it this way and not the way you
suggested (which seems to work better for me)?