NotUndoable not applied to registered properties?

NotUndoable not applied to registered properties?

Old forum URL: forums.lhotka.net/forums/t/4958.aspx


nelis posted on Tuesday, June 10, 2008

I have a BusinessBase<Road> object that declares following property

[NotUndoable()]

private static PropertyInfo<LaneList> ExitLanesProperty = RegisterProperty<LaneList>(typeof(Road), new PropertyInfo<LaneList>("ExitLanes"));

The NotUndoable attribute is not tested in FieldDataManager.CopyState. Is that on purpose? If so, why?

RockfordLhotka replied on Thursday, June 12, 2008

Properties using managed backing fields can't be marked as NotUndoable. If you have a value that should be ignored by undo, you need to use a private backing field.

Copyright (c) Marimer LLC