New to Telerik UI for WPFStart a free 30-day trial

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

Constructors

C#
public RadSmartPasteButton()

Fields

IconContentProperty

DependencyProperty

Identifies the IconContent dependency property.

C#
public static readonly DependencyProperty IconContentProperty

IconContentTemplateProperty

DependencyProperty

Identifies the IconContentTemplate dependency property.

C#
public static readonly DependencyProperty IconContentTemplateProperty

IconForegroundProperty

DependencyProperty

Identifies the IconForeground dependency property.

C#
public static readonly DependencyProperty IconForegroundProperty

IsProcessingProperty

DependencyProperty

Identifies the IsProcessing dependency property.

C#
public static readonly DependencyProperty IsProcessingProperty

ProcessingContentProperty

DependencyProperty

Identifies the ProcessingContent dependency property.

C#
public static readonly DependencyProperty ProcessingContentProperty

Identifies the ProcessingIconContent dependency property.

C#
public static readonly DependencyProperty ProcessingIconContentProperty

ProviderProperty

DependencyProperty

Identifies the Provider dependency property.

C#
public static readonly DependencyProperty ProviderProperty

Identifies the SmartPasteRequestCommand dependency property.

C#
public static readonly DependencyProperty SmartPasteRequestCommandProperty

Properties

Gets or sets the content displayed in the icon area.

C#
public object IconContent { get; set; }

Gets or sets the template used to render IconContent.

C#
public DataTemplate IconContentTemplate { get; set; }

Gets or sets the Brush used to render the button's icon glyph.

C#
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.

C#
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.

C#
public object ProcessingContent { get; set; }

Gets or sets the content displayed in the icon area while the button is processing.

C#
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.

C#
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.

C#
public ICommand SmartPasteRequestCommand { get; set; }

Methods

Invoke the base OnClick and execute the associated Command.

C#
protected override void OnClick()

Overrides: RadButton.OnClick()

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Overrides: RadButton.OnInitialized(EventArgs)

Events

Occurs when a smart paste operation is requested. Subscribe to this event to initiate the smart paste logic. Use CancellationToken to handle cancellation.

C#
public event EventHandler<SmartPasteButtonRequestContextEventArgs> SmartPasteRequest
Remarks:

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.