Merge branch 'temp8' into v8-fix-copy-media-types
This commit is contained in:
@@ -92,8 +92,8 @@ namespace Umbraco.Core.Models
|
||||
public readonly PropertyInfo AllowedAsRootSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.AllowedAsRoot);
|
||||
public readonly PropertyInfo IsContainerSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.IsContainer);
|
||||
public readonly PropertyInfo AllowedContentTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<ContentTypeSort>>(x => x.AllowedContentTypes);
|
||||
public readonly PropertyInfo PropertyGroupCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
|
||||
public readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<PropertyType>>(x => x.PropertyTypes);
|
||||
public readonly PropertyInfo PropertyGroupsSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, PropertyGroupCollection>(x => x.PropertyGroups);
|
||||
public readonly PropertyInfo PropertyTypesSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, IEnumerable<PropertyType>>(x => x.PropertyTypes);
|
||||
public readonly PropertyInfo HasPropertyTypeBeenRemovedSelector = ExpressionHelper.GetPropertyInfo<ContentTypeBase, bool>(x => x.HasPropertyTypeBeenRemoved);
|
||||
public readonly PropertyInfo VaryBy = ExpressionHelper.GetPropertyInfo<ContentTypeBase, ContentVariation>(x => x.Variations);
|
||||
|
||||
@@ -106,12 +106,12 @@ namespace Umbraco.Core.Models
|
||||
|
||||
protected void PropertyGroupsChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(Ps.Value.PropertyGroupCollectionSelector);
|
||||
OnPropertyChanged(Ps.Value.PropertyGroupsSelector);
|
||||
}
|
||||
|
||||
protected void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
|
||||
OnPropertyChanged(Ps.Value.PropertyTypesSelector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -263,6 +263,8 @@ namespace Umbraco.Core.Models
|
||||
get => _noGroupPropertyTypes;
|
||||
set
|
||||
{
|
||||
if (_noGroupPropertyTypes != null)
|
||||
_noGroupPropertyTypes.CollectionChanged -= PropertyTypesChanged;
|
||||
_noGroupPropertyTypes = new PropertyTypeCollection(IsPublishing, value);
|
||||
_noGroupPropertyTypes.CollectionChanged += PropertyTypesChanged;
|
||||
PropertyTypesChanged(_noGroupPropertyTypes, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
|
||||
@@ -376,7 +378,7 @@ namespace Umbraco.Core.Models
|
||||
if (!HasPropertyTypeBeenRemoved)
|
||||
{
|
||||
HasPropertyTypeBeenRemoved = true;
|
||||
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
|
||||
OnPropertyChanged(Ps.Value.PropertyTypesSelector);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -388,7 +390,7 @@ namespace Umbraco.Core.Models
|
||||
if (!HasPropertyTypeBeenRemoved)
|
||||
{
|
||||
HasPropertyTypeBeenRemoved = true;
|
||||
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
|
||||
OnPropertyChanged(Ps.Value.PropertyTypesSelector);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -412,7 +414,7 @@ namespace Umbraco.Core.Models
|
||||
|
||||
// actually remove the group
|
||||
PropertyGroups.RemoveItem(propertyGroupName);
|
||||
OnPropertyChanged(Ps.Value.PropertyGroupCollectionSelector);
|
||||
OnPropertyChanged(Ps.Value.PropertyGroupsSelector);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -35,12 +35,12 @@ namespace Umbraco.Core.Models
|
||||
{
|
||||
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, string>(x => x.Name);
|
||||
public readonly PropertyInfo SortOrderSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, int>(x => x.SortOrder);
|
||||
public readonly PropertyInfo PropertyTypeCollectionSelector = ExpressionHelper.GetPropertyInfo<PropertyGroup, PropertyTypeCollection>(x => x.PropertyTypes);
|
||||
public readonly PropertyInfo PropertyTypes = ExpressionHelper.GetPropertyInfo<PropertyGroup, PropertyTypeCollection>(x => x.PropertyTypes);
|
||||
}
|
||||
|
||||
private void PropertyTypesChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
OnPropertyChanged(Ps.Value.PropertyTypeCollectionSelector);
|
||||
OnPropertyChanged(Ps.Value.PropertyTypes);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -76,6 +76,8 @@ namespace Umbraco.Core.Models
|
||||
get => _propertyTypes;
|
||||
set
|
||||
{
|
||||
if (_propertyTypes != null)
|
||||
_propertyTypes.CollectionChanged -= PropertyTypesChanged;
|
||||
_propertyTypes = value;
|
||||
|
||||
// since we're adding this collection to this group,
|
||||
@@ -83,6 +85,7 @@ namespace Umbraco.Core.Models
|
||||
foreach (var propertyType in _propertyTypes)
|
||||
propertyType.PropertyGroupId = new Lazy<int>(() => Id);
|
||||
|
||||
OnPropertyChanged(Ps.Value.PropertyTypes);
|
||||
_propertyTypes.CollectionChanged += PropertyTypesChanged;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user