ClassRadSpeechToTextButtonElement
A button element that provides speech-to-text functionality using a speech recognizer.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class RadSpeechToTextButtonElement : LightVisualElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IPrimitiveElement, IShapedElement, IFillElement, IBorderElement, IBoxStyle, IBoxElement, IDrawFillElement, IImageElement, ITextPrimitive, ITextProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemUIItemBaseLightVisualElementRadSpeechToTextButtonElement
Implements:
Inherited Members
Constructors
RadSpeechToTextButtonElement()
Initializes a new instance of the RadSpeechToTextButtonElement class.
Declaration
public RadSpeechToTextButtonElement()
Fields
StateProperty
Identifies the State dependency property, representing the current state of the speech recognizer.
Properties
AllowAnimation
Gets or sets a value indicating whether to use pulse animation when the state is Listening.
IsContinuousRecognition
Gets or sets a value indicating whether the speech recognizer operates in continuous recognition mode.
When set to true, the recognizer will continuously listen and recognize speech until stopped.
When set to false, recognizer will stop automatically after a single utterance or pause.
LanguageTag
Gets or sets the IETF BCP 47 language tag for the speech recognizer. For example "en-US", "de-DE".
SpeechRecognizerCreator
Gets or sets the custom factory that creates a IRadSpeechRecognizer instance.
Declaration
[Browsable(false)]
public Func<IRadSpeechRecognizer> SpeechRecognizerCreator { get; set; }
Property Value
State
Gets the current state of the speech recognizer.
Declaration
public SpeechRecognizerState State { get; }
Property Value
ToolTipStates
Gets or sets the recognizer states in which the tooltip callout is enabled.
Declaration
public IList<SpeechRecognizerState> ToolTipStates { get; set; }
Property Value
IList<SpeechRecognizerState>
Methods
DisposeManagedResources()
Disposes of managed resources including cached images and SVG images when the element is being disposed.
Declaration
protected override void DisposeManagedResources()
Overrides
GetCalloutContent()
Gets the content object used in the callout tooltip based on the current speech recognizer state.
Declaration
protected virtual string GetCalloutContent()
Returns
A localized string describing the action for the current state, or null when no tooltip should be shown.
InitializeFields()
Initializes visual appearance fields such as border and fill settings, and applies theme value overrides for different visual states.
Declaration
protected override void InitializeFields()
Overrides
OnClick(EventArgs)
Handles the click event by invoking the base handler and asynchronously performing additional actions.
Declaration
protected override void OnClick(EventArgs e)
Parameters
e
An EventArgs object that contains the event data.
Overrides
OnIsContinuousRecognitionChanged()
Initializes the speech recognizer if it has not already been initialized when the continuous recognition setting changes.
Declaration
protected virtual void OnIsContinuousRecognitionChanged()
OnLanguageTagChanged()
Handles changes to the language tag by initializing the speech recognizer if necessary.
Declaration
protected virtual void OnLanguageTagChanged()
OnLoaded()
Called when the element has been successfully loaded. That includes loading of all its children as well.
Declaration
protected override void OnLoaded()
Overrides
OnMouseEnter(EventArgs)
Declaration
protected override void OnMouseEnter(EventArgs e)
Parameters
e
Overrides
OnMouseLeave(EventArgs)
Declaration
protected override void OnMouseLeave(EventArgs e)
Parameters
e
Overrides
OnPropertyChanged(RadPropertyChangedEventArgs)
Called when a property value has changed, handling item-specific property change logic including text, visual state, and animation properties.
Declaration
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
Parameters
e
The property changed event arguments.
Overrides
OnSpeechRecognizerCreatorChanged()
Handles changes to the speech recognizer creator by disposing the current recognizer and creating a new one if the element is loaded.
Declaration
protected virtual void OnSpeechRecognizerCreatorChanged()
OnStateChanged()
Raises the StateChanged event and manages the listening animation lifecycle.
Declaration
protected virtual void OnStateChanged()
StopListening()
Stops the speech to text button from listening.
If the speech recognizer is currently in the StartingListening or Listening state, this method will stop the recognition process. If the recognizer is not listening, this method has no effect.
Events
CalloutOpening
Occurs before the callout tooltip is opened, allowing customization or cancellation.
Declaration
public event EventHandler<SpeechToTextTooltipOpeningEventArgs> CalloutOpening
Event Value
ErrorOccurred
Occurs when an error is encountered by the speech recognizer.
Declaration
public event EventHandler<SpeechRecognizerErrorOccurredEventArgs> ErrorOccurred
Event Value
SpeechRecognized
Occurs when speech is successfully recognized.
Declaration
public event EventHandler<SpeechRecognizerSpeechRecognizedEventArgs> SpeechRecognized
Event Value
StateChanged
Occurs when the state of the speech recognizer changes.