I just tried to use ExtendedWeakReference on a FEZ Spider (MF 4.2, Firmware 4.2.9) with the code given in the MF sample or I read in the forum. Unfortunately it doesn’t save anything. The target of ExtendedWeakReference.RecoverOrCreate(…) is always null. Is there anything to enable it?
Code - writing
var ewr = ExtendedWeakReference.RecoverOrCreate(typeof(TypeUniqueToOurApp), 0, ExtendedWeakReference.c_SurvivePowerdown);
ewr.Priority = (Int32)ExtendedWeakReference.PriorityLevel.Critical;
var numBoots = ewr.Target as NumBoots;
if (numBoots == null)
numBoots = new NumBoots(1);
else
numBoots.BootCount += 1;
ewr.Target = numBoots;
Code - reading
var ewr = ExtendedWeakReference.RecoverOrCreate(typeof(TypeUniqueToOurApp), 0, ExtendedWeakReference.c_SurvivePowerdown);
var numBoots = ewr.Target as NumBoots;
numBoots is always null!
Thanks for helping.