Displays paste-formatting choices as mutually exclusive toggle buttons and applies the selected option.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.RichTextEditor.dll
Syntax:
public class RadMenuPasteOptionsToggleItem : RadMenuPasteOptionsButtonItem, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IBindableComponent, IComponent, IDisposable, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode, IButtonControl, IImageElement, IHierarchicalItem, IItemsOwner, ISiteProvider
Inheritance: objectDisposableObjectRadObjectRadElementVisualElementRadComponentElementRadItemRadButtonItemRadMenuItemBaseRadMenuPasteOptionsButtonItemRadMenuPasteOptionsToggleItem...
Implements:
Inherited Members
Constructors
Initializes the menu item with toggle buttons for the available paste-formatting choices.
public RadMenuPasteOptionsToggleItem()
Properties
Gets the view model created from the associated editor's current paste context.
public PasteOptionsViewModel DataContext { get; }
Gets whether toggle-state changes are currently being batched.
public bool IsUpdating { get; }
Uses the standard menu-item theme styles for this specialized paste-options item.
protected override Type ThemeEffectiveType { get; }
Overrides:
Methods
Begins a batch of toggle-state changes without applying intermediate choices.
public void BeginUpdate()
Pair each call with EndUpdate() after the batch is complete.
Adds toggle-state handlers and shortcut tooltips to the paste-option buttons created by the base method.
protected override void CreateChildElements()
Overrides:
Creates the toggle button for merging source and destination formatting.
protected override RadButtonElement CreateMergeFormattingButton()
The toggle button for the merge-formatting choice.
Overrides:
Creates the toggle button for keeping source formatting.
protected override RadButtonElement CreateSourceFormattingButton()
The toggle button for the keep-source-formatting choice.
Overrides:
Creates the toggle button for pasting text without formatting.
protected override RadButtonElement CreateTextOnlyButton()
The toggle button for the keep-text-only choice.
Overrides:
Creates the toggle button for applying destination styles.
protected override RadButtonElement CreateUseDestinationSylesButton()
The toggle button for the use-destination-styles choice.
Overrides:
Detaches the toggle-state handlers from the source-formatting, text-only, and merge-formatting buttons.
protected override void DisposeManagedResources()
Overrides:
Ends a batch started by BeginUpdate().
public void EndUpdate()
Enables mouse input handling so the menu item can receive clicks on its paste buttons.
protected override void InitializeFields()
Overrides:
Applies merge-formatting and clears the other paste-option toggles.
protected virtual void OnButtonMergeFormattingToggleStateChanged(object sender, StateChangedEventArgs args)
The merge-formatting toggle button.
argsStateChangedEventArgsThe state-change event data.
Applies keep-source-formatting and clears the other paste-option toggles.
protected virtual void OnButtonSourceFormattingToggleStateChanged(object sender, StateChangedEventArgs args)
The source-formatting toggle button.
argsStateChangedEventArgsThe state-change event data.
Applies keep-text-only and clears the other paste-option toggles.
protected virtual void OnButtonTextOnlyToggleStateChanged(object sender, StateChangedEventArgs args)
The text-only toggle button.
argsStateChangedEventArgsThe state-change event data.
Applies destination styles and clears the other paste-option toggles.
protected virtual void OnButtonUseDestinationSylesToggleStateChanged(object sender, StateChangedEventArgs args)
The destination-styles toggle button.
argsStateChangedEventArgsThe state-change event data.
Creates the view model for the new owner's current paste context and clears the source-formatting, merge-formatting, and text-only toggles.
protected override void OnOwnerChanged(RadRichTextBox owner)
The editor associated with this menu item.
Overrides:
If the owner or its current paste context is null, the existing view model and toggle state are unchanged.
Cancels a pending state change when the currently selected option is clicked again.
protected virtual void OnToggleButtonStateChanging(object sender, StateChangingEventArgs args)
The toggle button whose state is changing.
argsStateChangingEventArgsThe state-change event data.
Replaces the current pasted content using the specified option.
protected override void ProceedPasteOption(PasteOption pasteOption)
The formatting option to apply to the replacement paste.
Overrides:
The method first undoes the current paste, then pastes again with the selected option.
Clears the checked state of the source-formatting, merge-formatting, and text-only buttons.
protected virtual void ResetToggleState()
The destination-styles button is not changed by this method.
Selects the toggle that matches the owner's current paste option.
protected virtual void SetInitialToggleState()