ClassPromptInputAttachedFilesElement
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
PromptInputAttachedFilesElement()
Initializes a new instance of the PromptInputAttachedFilesElement class.
Declaration
public PromptInputAttachedFilesElement()
Properties
AttachedFiles
Gets the collection of attached files displayed in the files area.
Declaration
[Browsable(false)]
public ObservableCollection<PromptInputAttachedFile> AttachedFiles { get; }
Property Value
AttachedFilesPanel
Gets the attached files wrap layout panel.
Declaration
[Browsable(false)]
public WrapLayoutPanel AttachedFilesPanel { get; }
Property Value
FileIconProvider
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.
Declaration
[Browsable(false)]
public Func<string, PromptInputFileIcon> FileIconProvider { get; set; }
Property Value
MaxVisibleRows
Gets or sets the maximum number of visible rows before a scrollbar appears.
ScrollViewer
Gets the scroll viewer that wraps the attached files panel.
Declaration
[Browsable(false)]
public RadScrollViewer ScrollViewer { get; }
Property Value
Methods
AttachFiles()
Opens the file attachment dialog for all file types.
Declaration
public void AttachFiles()
AttachPhotos()
Opens the file attachment dialog for image file types.
Declaration
public void AttachPhotos()
CreateAttachedFileChip(PromptInputAttachedFile)
Creates a visual element representing an attached file chip. Override to customize.
Declaration
protected virtual PromptInputAttachedFileElement CreateAttachedFileChip(PromptInputAttachedFile file)
Parameters
file
Returns
CreateAttachedFilesPanel()
Creates the attached files wrap layout panel. Override to customize.
Declaration
protected virtual WrapLayoutPanel CreateAttachedFilesPanel()
Returns
CreateChildElements()
Called by the element when constructed. Allows inheritors to build the element tree.
Declaration
protected override void CreateChildElements()
Overrides
CreateScrollViewer()
Creates the scroll viewer that wraps the attached files panel. Override to customize.
Declaration
protected virtual RadScrollViewer CreateScrollViewer()
Returns
DisposeManagedResources()
Disposes of managed resources including cached images and SVG images when the element is being disposed.
Declaration
protected override void DisposeManagedResources()
Overrides
InitializeFields()
Initializes the internal fields and components of the LightVisualElement. This method sets up text primitives, image primitives, and layout management components.
Declaration
protected override void InitializeFields()
Overrides
OnAttachedFileRemoved(PromptInputAttachedFileRemovedEventArgs)
Raises the AttachedFileRemoved event.
Declaration
protected virtual void OnAttachedFileRemoved(PromptInputAttachedFileRemovedEventArgs args)
Parameters
args
OnAttachedFileRemoving(PromptInputAttachedFileRemovingEventArgs)
Raises the AttachedFileRemoving event.
Declaration
protected virtual void OnAttachedFileRemoving(PromptInputAttachedFileRemovingEventArgs args)
Parameters
args
OnAttachedFilesChanged(EventArgs)
Raises the AttachedFilesChanged event.
Declaration
protected virtual void OnAttachedFilesChanged(EventArgs args)
Parameters
args
OnDialogOpening(PromptInputDialogOpeningEventArgs)
Raises the DialogOpening event.
Declaration
protected virtual void OnDialogOpening(PromptInputDialogOpeningEventArgs args)
Parameters
args
OnMouseWheel(MouseEventArgs)
Raises the MouseWheel event.
Declaration
protected override void OnMouseWheel(MouseEventArgs e)
Parameters
e
The mouse event arguments.
Overrides
RemoveAttachedFile(PromptInputAttachedFile)
Removes the specified file from the AttachedFiles collection. Raises AttachedFileRemoving beforehand (cancelable) and AttachedFileRemoved afterwards.
Declaration
public void RemoveAttachedFile(PromptInputAttachedFile file)
Parameters
file
Events
AttachedFileRemoved
Occurs after an attached file has been removed from the AttachedFiles collection via RemoveAttachedFile(PromptInputAttachedFile).
Declaration
public event PromptInputAttachedFileRemovedEventHandler AttachedFileRemoved
Event Value
AttachedFileRemoving
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.
Declaration
public event PromptInputAttachedFileRemovingEventHandler AttachedFileRemoving
Event Value
AttachedFilesChanged
Occurs when the attached files collection changes. Used by the parent element to update the send button state.
Declaration
public event EventHandler AttachedFilesChanged
Event Value
DialogOpening
Occurs when a file dialog is about to open.
Set Cancel to true to suppress the built-in dialog
and handle file selection externally; populate
FileNames in that case to still create attachments.
Declaration
public event PromptInputDialogOpeningEventHandler DialogOpening
Event Value