BaseChatItemElement
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class BaseChatItemElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider, IVirtualizedElement<BaseChatDataItem>
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementBaseChatItemElement...
Derived Classes:
Implements:
Inherited Members
Constructors
public BaseChatItemElement()
Fields
public static RadProperty IsOwnMessageProperty
Properties
public virtual ChatMessageAvatarElement AvatarPictureElement { get; }
Gets the associated data.
public virtual BaseChatDataItem Data { get; protected set; }
The data.
Implements:
public bool IsOwnMessage { get; set; }
public LightVisualElement MainMessageElement { get; }
public ChatMessageNameElement NameLabelElement { get; }
protected bool ShowAvatar { get; }
protected virtual bool ShowNameLabel { get; }
protected virtual bool ShowStatusLabel { get; }
public ChatMessageStatusElement StatusLabelElement { get; }
Methods
Arranges the content and child elements within the final allocated space, positioning text, images, and child elements.
Attaches the specified data.
public virtual void Attach(BaseChatDataItem data, object context)
The data.
contextobjectThe context.
Implements:
protected virtual ChatMessageAvatarElement CreateAvatarElement()
Called by the element when constructed. Allows inheritors to build the element tree.
protected override void CreateChildElements()
Overrides:
Creates a reply bubble element for a reply message. Override to customize.
protected virtual ChatReplyBubbleElement CreateReplyBubbleElement()
Creates the stack element that hosts the reply bubbles. Override to customize.
protected virtual void DataPropertyChanged(object sender, PropertyChangedEventArgs e)
Detaches this instance.
public virtual void Detach()
Implements:
Disposes managed resources.
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:
Determines whether element is compatible with the specified data.
public virtual bool IsCompatible(BaseChatDataItem data, object context)
The data.
contextobjectThe context.
Returns:true if the specified data is compatible; otherwise, false.
Implements:
Measures the desired size of the element by calculating the space needed for content, padding, and borders.
Handles the mouse right-click to show the context menu.
Handles a click on a reply bubble. By default raises the ReplyBubbleClicked event on
the chat element and, when not handled, scrolls the chat view to the message being replied to.
protected virtual void OnReplyBubbleClicked(ChatMessage replyToMessage)
Gets a value indicating whether a child will be arranged during the ArrangeOverride(SizeF).
protected override bool ShouldArrangeChild(RadElement child)
The child element to check.
Returns:Whether the child will be arranged in ArrangeOverride.
Overrides:
Gets a value indicating, whether a child will be measured during the MeasureOverride.
protected override bool ShouldMeasureChild(RadElement child)
The child.
Returns:Whether the child will be measured in MeasureOverride.
Overrides:
Shows the context menu for this message.
Synchronizes this instance.
public virtual void Synchronize()
Implements:
Rebuilds the reply bubbles inside the supplied stack to match the current data's ReplyToMessages. Sets the stack's visibility based on the reply state. Subclasses are responsible for adding the stack into their visual tree.
protected virtual void SynchronizeReplyBubbles(StackLayoutElement replyBubblesStack)