Updates all Entity models to use SetPropertyValueAndDetectChanges for setting all simple properties so that
tracking changes works the way it is supposed to. Creates a TracksChangesEntityBase class for any other entity that wants to implement IRememberBeingDirty (now Entity inherits from this). Upgraded a bunch of other entities that were not tracking changes properly.
This commit is contained in:
@@ -42,8 +42,11 @@ namespace Umbraco.Core.Models
|
||||
get { return _parentId; }
|
||||
set
|
||||
{
|
||||
_parentId = value;
|
||||
OnPropertyChanged(ParentIdSelector);
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_parentId = value;
|
||||
return _parentId;
|
||||
}, _parentId, ParentIdSelector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,8 +59,11 @@ namespace Umbraco.Core.Models
|
||||
get { return _itemKey; }
|
||||
set
|
||||
{
|
||||
_itemKey = value;
|
||||
OnPropertyChanged(ItemKeySelector);
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_itemKey = value;
|
||||
return _itemKey;
|
||||
}, _itemKey, ItemKeySelector);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,8 +76,11 @@ namespace Umbraco.Core.Models
|
||||
get { return _translations; }
|
||||
set
|
||||
{
|
||||
_translations = value;
|
||||
OnPropertyChanged(TranslationsSelector);
|
||||
SetPropertyValueAndDetectChanges(o =>
|
||||
{
|
||||
_translations = value;
|
||||
return _translations;
|
||||
}, _translations, TranslationsSelector);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user