Gotya, Sir.  Thanks for getting back to me!

Alright, here's what the situation is like:

App (globally available class to the whole application)
{
        public static WindsorContainer container { get; set; }

        protected override void OnStartup(StartupEventArgs e)
        {
        container = new WindsorContainer(new XmlInterpreter());
        }
}

public ClassA (WPF Code Behind File)
{
        private ClassB classB;
        get { return ClassB; }
        set
        {
                classB = value;
                DataContext = value;
        }

        public ClassA()
        {
                ClassB = App.Resolve<ClassB>();
        }
}

public ClassB //View Model, contains a collection of items, each that
has to be resolved  ***THIS IS RESOLVED***.  It's in this class that
it falls apart.
{
        public ObservableCollection<ClassCViewModel> { get; set;} (Collection
of ClassC view models -- another class that has a ClassC as a member)

        private SomeMethodInClassB()
        {
                var collectionOfClassCs = Repository.Get(); (Not a part of the
dependency setup -- yet; just a hard coded data access class)
                foreach(var classC in collectionOfClassCs)
                {
                        var classD = App.Container.Resolve<ClassD>();  
//Resolving every
class D as needed -- one for each record pulled from the repository.
***THIS IS NOT RESOLVED***
                        classD.ClassC = classC;
                }
        }
}

//I haven't gotten any lower, as I'm not able to resolve the above
yet.

public ClassC
{
        public ClassD { get; set;}
}

public ClassD
{
        public IDependency1 { get; set; }
}

public IDependency1
{
        public IDependency2 { get; set; }
}


//////////////////////////////END SETUP 1

I tried a situation like this also -- putting a ClassD as a member of
ClassB (thereby bypassing the whole collection thing) and it resolved
the ClassD member -- but nothing below it in the hierarchy.

//////////////////////////////END SETUP 2

So I don't know.  I'll try looking at my configuration again.  I just
put everything in the App.Config file, and there is no hierarchy set
there, I just put it all in.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to