RadSmartPasteButton
Represents a button that performs AI-powered smart paste. When clicked, the button reads the clipboard content, gathers field metadata from the assigned Provider, raises the SmartPasteRequest event so the application can send the data to an AI service, and then distributes the extracted values back to the provider's fields. The button supports a processing visual state with built-in cancellation.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
[TelerikToolboxCategory("Buttons")]
public class RadSmartPasteButton : RadButton
Inheritance: objectRadButtonRadSmartPasteButton
Inherited Members
Constructors
public RadSmartPasteButton()
Fields
IconContentProperty
DependencyProperty
Identifies the IconContent dependency property.
public static readonly DependencyProperty IconContentProperty
IconContentTemplateProperty
DependencyProperty
Identifies the IconContentTemplate dependency property.
public static readonly DependencyProperty IconContentTemplateProperty
IconForegroundProperty
DependencyProperty
Identifies the IconForeground dependency property.
public static readonly DependencyProperty IconForegroundProperty
IsProcessingProperty
DependencyProperty
Identifies the IsProcessing dependency property.
public static readonly DependencyProperty IsProcessingProperty
ProcessingContentProperty
DependencyProperty
Identifies the ProcessingContent dependency property.
public static readonly DependencyProperty ProcessingContentProperty
ProcessingIconContentProperty
DependencyProperty
Identifies the ProcessingIconContent dependency property.
public static readonly DependencyProperty ProcessingIconContentProperty
ProviderProperty
DependencyProperty
Identifies the Provider dependency property.
public static readonly DependencyProperty ProviderProperty
SmartPasteRequestCommandProperty
DependencyProperty
Identifies the SmartPasteRequestCommand dependency property.
public static readonly DependencyProperty SmartPasteRequestCommandProperty
Properties
Gets or sets the content displayed in the icon area.
public object IconContent { get; set; }
IconContentTemplate
DataTemplate
Gets or sets the template used to render IconContent.
public DataTemplate IconContentTemplate { get; set; }
IconForeground
Brush
Gets or sets the Brush used to render the button's icon glyph.
public Brush IconForeground { get; set; }
Gets a value indicating whether the button is in processing state. When true, the button displays a processing visual state.
public bool IsProcessing { get; }
Gets or sets the content displayed in the button while a smart paste operation is in progress. If not set, the default processing content is used.
public object ProcessingContent { get; set; }
Gets or sets the content displayed in the icon area while the button is processing.
public object ProcessingIconContent { get; set; }
Gets or sets the smart paste provider that supplies fields and handles value assignment for the smart paste operation. Typically, this would be set to a container view (like a Form or Layout) that implements ISmartPasteButtonProvider.
public ISmartPasteButtonProvider Provider { get; set; }
Gets or sets the command that is executed when a smart paste operation is requested. The command parameter is of type SmartPasteButtonRequestContextEventArgs.
public ICommand SmartPasteRequestCommand { get; set; }
Methods
Invoke the base OnClick and execute the associated Command.
protected override void OnClick()
Overrides:
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Overrides:
Events
Occurs when a smart paste operation is requested. Subscribe to this event to initiate the smart paste logic. Use CancellationToken to handle cancellation.
public event EventHandler<SmartPasteButtonRequestContextEventArgs> SmartPasteRequest
Security — Prompt Injection: The Content property contains raw clipboard text supplied by the user. Before incorporating this value into a prompt sent to an AI service, consider sanitizing or contextually isolating it to prevent prompt injection attacks where malicious clipboard content attempts to override the AI's instructions.