Your structure is confusing which means there may be a simpler design.
However, I think you should be able to solve the issue by giving
SubClass1Indexer a constructor that took a List<ISubClass1> rather than a
MainClass.
Post again if this doesnt work out.

Signature
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
> SITUATION:
> I have a class "MainClass" that has an indexer "SubClass1Indexer".
[quoted text clipped - 123 lines]
> }
> }
hufaunder@yahoo.com - 16 Feb 2007 17:07 GMT
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/default.asp?url=/library/en-us/csref/html/vcwl
kIndexedPropertiesTutorial.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)?