How to ignore base class properties

Mar 9, 2012 at 9:07 PM

I finally debugged a horrendous issue that arose when trying to save/load some ViewModels that were inherited from CaliburnMicro.Screen objects.  They contain a Parent object property that obviously changes depending on where you use the viewmodel.  The parent object can also be a large complicated object.

The SerializationHelper._CacheProperties was picking it up each time and either changing Parent depending on when I loaded/saved it as well as sometimes creating huge recursive objects.

It is also picking up IsNotifying from the absolute base class of PropertyChangedBase.

I have a base class I am using inbetween Screen and my ViewModel implementation so I was able to add an override of Parent and mark it with the SterlingIgnore attribute but I don't want to have to do that everywhere and I don't want to change the CM source either.

Am I missing something?  It would be nice to be able to tell Sterling to ignore the base class somehow or any properties associated with it.  Especially when it comes from a 3rd party.  I'm adding an Issue for this which I can remove if I am indeed missing something simple.

I would want to be able to do this globally, say in the table defintions to ignore Screen in any table.

public class MyViewModel : MyViewModelBase : Screen


public class SomeOtherLibraryNameSpace.Screen { public object Parent {get;set;}}