Represents the attached files area of the RadPromptInputElement. Manages the collection of attached files, their visual chip elements, and the file/photo attachment dialogs.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class PromptInputAttachedFilesElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementPromptInputAttachedFilesElement...
Implements:
Inherited Members
Constructors
Initializes a new instance of the PromptInputAttachedFilesElement class.
public PromptInputAttachedFilesElement()
Properties
Gets the collection of attached files displayed in the files area.
[Browsable(false)]
public ObservableCollection<PromptInputAttachedFile> AttachedFiles { get; }
Gets the attached files wrap layout panel.
[Browsable(false)]
public WrapLayoutPanel AttachedFilesPanel { get; }
Gets or sets a callback that resolves the icon displayed next to an attached file.
The callback receives the file name and should return a PromptInputFileIcon
containing a glyph character, an Image, or a
RadSvgImage. Return null to fall back to the
default extension-based glyph.
[Browsable(false)]
public Func<string, PromptInputFileIcon> FileIconProvider { get; set; }
Gets or sets the maximum number of visible rows before a scrollbar appears.
public int MaxVisibleRows { get; set; }
Gets the scroll viewer that wraps the attached files panel.
[Browsable(false)]
public RadScrollViewer ScrollViewer { get; }
Methods
Opens the file attachment dialog for all file types.
public void AttachFiles()
Opens the file attachment dialog for image file types.
public void AttachPhotos()
Creates a visual element representing an attached file chip. Override to customize.
protected virtual PromptInputAttachedFileElement CreateAttachedFileChip(PromptInputAttachedFile file)
Creates the attached files wrap layout panel. Override to customize.
Called by the element when constructed. Allows inheritors to build the element tree.
protected override void CreateChildElements()
Overrides:
Creates the scroll viewer that wraps the attached files panel. Override to customize.
Disposes of managed resources including cached images and SVG images when the element is being disposed.
protected override void DisposeManagedResources()
Overrides:
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
protected override void InitializeFields()
Overrides:
Raises the AttachedFileRemoved event.
protected virtual void OnAttachedFileRemoved(PromptInputAttachedFileRemovedEventArgs args)
Raises the AttachedFileRemoving event.
protected virtual void OnAttachedFileRemoving(PromptInputAttachedFileRemovingEventArgs args)
Raises the AttachedFilesChanged event.
Raises the DialogOpening event.
protected virtual void OnDialogOpening(PromptInputDialogOpeningEventArgs args)
Raises the MouseWheel event.
protected override void OnMouseWheel(MouseEventArgs e)
The mouse event arguments.
Overrides:
Removes the specified file from the AttachedFiles collection. Raises AttachedFileRemoving beforehand (cancelable) and AttachedFileRemoved afterwards.
public void RemoveAttachedFile(PromptInputAttachedFile file)
Events
Occurs after an attached file has been removed from the AttachedFiles collection via RemoveAttachedFile(PromptInputAttachedFile).
public event PromptInputAttachedFileRemovedEventHandler AttachedFileRemoved
Occurs before an attached file is removed as a result of the user clicking
the remove button on its chip. Set Cancel to
true to keep the file in the AttachedFiles collection.
public event PromptInputAttachedFileRemovingEventHandler AttachedFileRemoving
Occurs when the attached files collection changes. Used by the parent element to update the send button state.
public event EventHandler AttachedFilesChanged