Class ObjectPickerPreview
The resizable preview pane of an ObjectPicker.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class ObjectPickerPreview : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
It measures its own height and switches between three layouts, exposed as
context and reflected as a --context-* styling class. Exported so a
custom picker can host it; ObjectPicker builds one for you.
Constructors
ObjectPickerPreview()
Default constructor.
Declaration
public ObjectPickerPreview()
Fields
contextUssClassName
The ObjectPickerPreview context styling class.
Declaration
public const string contextUssClassName = "appui-objectpickerpreview--context-"
Field Value
| Type | Description |
|---|---|
| string |
emptyUssClassName
The ObjectPickerPreview empty-state styling class.
Declaration
public const string emptyUssClassName = "appui-objectpickerpreview__empty"
Field Value
| Type | Description |
|---|---|
| string |
metaUssClassName
The ObjectPickerPreview metadata container styling class.
Declaration
public const string metaUssClassName = "appui-objectpickerpreview__meta"
Field Value
| Type | Description |
|---|---|
| string |
nameUssClassName
The ObjectPickerPreview name styling class.
Declaration
public const string nameUssClassName = "appui-objectpickerpreview__name"
Field Value
| Type | Description |
|---|---|
| string |
pathUssClassName
The ObjectPickerPreview path styling class.
Declaration
public const string pathUssClassName = "appui-objectpickerpreview__path"
Field Value
| Type | Description |
|---|---|
| string |
thumbnailIconUssClassName
The ObjectPickerPreview thumbnail icon styling class.
Declaration
public const string thumbnailIconUssClassName = "appui-objectpickerpreview__thumbnail-icon"
Field Value
| Type | Description |
|---|---|
| string |
thumbnailUssClassName
The ObjectPickerPreview thumbnail styling class.
Declaration
public const string thumbnailUssClassName = "appui-objectpickerpreview__thumbnail"
Field Value
| Type | Description |
|---|---|
| string |
typeUssClassName
The ObjectPickerPreview type styling class.
Declaration
public const string typeUssClassName = "appui-objectpickerpreview__type"
Field Value
| Type | Description |
|---|---|
| string |
ussClassName
The ObjectPickerPreview main styling class.
Declaration
public const string ussClassName = "appui-objectpickerpreview"
Field Value
| Type | Description |
|---|---|
| string |
Properties
contentContainer
Logical container where child elements are added. If a child is added to this element, the child is added to this element's content container instead.
Declaration
public override VisualElement contentContainer { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
Overrides
context
The layout the preview currently uses, derived from its height.
Declaration
[CreateProperty(ReadOnly = true)]
public ObjectPickerPreviewContext context { get; }
Property Value
| Type | Description |
|---|---|
| ObjectPickerPreviewContext |
item
The item being previewed, or null for the empty state.
Declaration
public ObjectPickerItem item { get; set; }
Property Value
| Type | Description |
|---|---|
| ObjectPickerItem |
renderPreview
Replaces the preview body. Receives the item and the live layout context, and returns the element to show. Set to null to go back to the built-in layouts.
Declaration
public Func<ObjectPickerItem, ObjectPickerPreviewContext, VisualElement> renderPreview { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<ObjectPickerItem, ObjectPickerPreviewContext, VisualElement> |
Methods
GetContextUssClassName(ObjectPickerPreviewContext)
Declaration
public static string GetContextUssClassName(ObjectPickerPreviewContext enumValue)
Parameters
| Type | Name | Description |
|---|---|---|
| ObjectPickerPreviewContext | enumValue |
Returns
| Type | Description |
|---|---|
| string |