Topics: Issues / bugs
Apr 4, 2012 at 9:28 AM
Edited Apr 4, 2012 at 9:30 AM

Hello I get an StackOverflowException in the DebugLogListener: At this Place:


public override void Write(ILog log, string message, LogEvent logEvent)
    string consoleMessage = string.Format("{0} => [{1}] {2}", DateTime.Now.ToString("hh:mm:ss:fff"),
      logEvent.ToString().ToUpper(), message);



The Methods OnDeserialization and CallOnDeserializationCallback called very very often. I think the consequence of an recursiv call.

Do you have any idea what i made wrong. Any tipps?

Apr 4, 2012 at 9:36 AM

I think it is not the logging that that is wrong, you are probably facing this issue:

Apr 4, 2012 at 9:54 AM

I also think it is not the logging.

Maybe it is this issue. My Model is a Composite.

A Model has a list of Models and each Model has a Reference to the Parent which is also from the same Typ. 

Apr 4, 2012 at 9:56 AM

The Exception only occurs when i Register the Property in the DataobjectBase. When i implement a normal property i get no error.

Apr 4, 2012 at 10:07 AM

That's because only when they are known in the property bag (Containing all property values), they are backed up.

Apr 4, 2012 at 10:11 AM

 Ok. Is there a workaround or do i have to wait until the issue is solved?

Apr 4, 2012 at 10:13 AM

Well, the DOB does implement the IParent interface if I am not mistaken. What you can also do is implement the parent as wrapper (does making it a "regular" property, then it will not be backed up (which is what should happen)).

Apr 4, 2012 at 10:33 AM

Ok. Wrapper? Little Example?

Apr 4, 2012 at 10:38 AM

Try casting a child item to IParent interface. After deserializing or construction, it should be filled. If that doesn't work, go for the simple properties for now.

Apr 4, 2012 at 10:49 AM
After deserializing or construction, it should be filled. 

Do i have to fill it, or sould it filled automaticaly?

Sorry, at the moment its not clear for me, what i have to do.

Apr 4, 2012 at 11:19 AM

It should be filled automatically. If not, then I have to write docs (but it is a long time ago (3 years) when I wrote that part, so I don't know it out of my head).

Apr 4, 2012 at 1:33 PM
Edited Apr 4, 2012 at 1:34 PM

Ok its filled but only in constructor. When i fill the list not in the constructor i have set the Parent manual. Not so easy because the SetParent method in DataObjectBase is protected

In this way it works. I need an static method in MyModel.


    protected static void SetParent(MyModel mm, IParent parent) 

MyListModel : MyModel


public ObservableCollection MyModelList { get { return GetValue<ObservableCollection<MyModel>>(MyModelListProperty); } set { SetValue(MyModelListProperty, value); } } public static readonly PropertyData MyModelList= RegisterProperty("MyModelList", typeof(ObservableCollection<MyModel>)); public void Add(MyModel model) { SetParent(model,this); MyModelList.Add(model); } }

Maybe you have an better solution

Apr 4, 2012 at 3:29 PM

I had the same issue. In have a tree like model and in every model I want to keep a reference to it's parent. When I added this parent reference I got a stackoverflow during registration.

Now I have made my parent a "normal" property since it is not going to change in my case. I have added it to the constructor and set it there.

When I have a reference to a model I can now walk the tree back to the root.

Apr 16, 2012 at 7:38 AM

Yes. Like i say. Only in the constructor. When you add an object later you have to do that in the add method or on a property changed event.

Apr 17, 2012 at 9:19 AM

We are planning to take a look at this in 3.2.

Jul 2, 2012 at 6:40 PM

This issue should be solved. Can you please verify that it is fixed?