JD2022-TU1/main/tools/framework/UAF.PropertyGrid/ClrCustomTemplatePropertyItem.cs

32 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using UAF.Interfaces.Editors;
using Ubisoft.Commands;
using Ubisoft.Controls.Wpf.PropertyBrowser.ClrProvider;
using Ubisoft.Controls.Wpf.PropertyBrowser.Favorites;
using Ubisoft.Controls.Wpf.PropertyBrowser.PropertyItems;
using Ubisoft.Controls.Wpf.PropertyBrowser.ViewModels;
namespace UAF.PropertyGrid
{
/// <summary>
/// Property item that should take the key of the template for edition.
/// </summary>
public class ClrCustomTemplatePropertyItem : ClrObjectPropertyItem
{
public ClrCustomTemplatePropertyItem(PropertyDescriptor propertyDescriptor, object[] objectInstances,
object aggregatedValue, bool isHomogeneous, ClrPropertyProvider propertyProvider,
IPropertyCollection rootHolders, PropertyEditorAttribute attribute)
: base(propertyDescriptor, objectInstances, aggregatedValue, isHomogeneous, propertyProvider, rootHolders, null, false)
{
ValueEditorTemplateKey = attribute.TemplateKey;
if (!attribute.CanExpand)
PropertyItemTemplateKey = "PropertyItemLeftLabelTemplate";
}
}
}