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

Represents a wrapper of ITextBasedDocumentFormatProvider allowing the latter to be used in data binding scenarios.

Definition

Namespace:Telerik.Windows.Documents.FormatProviders

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

C#
public class DataProviderBase : FrameworkElement

Inheritance: objectDataProviderBase

Derived Classes: HtmlDataProviderRtfDataProviderTxtDataProviderXamlDataProvider

Constructors

Initializes a new instance of the DataProviderBase class.

C#
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, DependencyProperty stringProperty)
Parameters:formatProviderITextBasedDocumentFormatProvider

The format provider.

stringPropertyDependencyProperty

The string property.

Initializes a new instance of the DataProviderBase class.

C#
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, FrameworkElement propertyOwner, DependencyProperty stringProperty)
Parameters:formatProviderITextBasedDocumentFormatProvider

The format provider.

propertyOwnerFrameworkElement

The property owner.

stringPropertyDependencyProperty

The string property.

Fields

FormatProviderProperty

DependencyProperty

The format provider property.

C#
public static readonly DependencyProperty FormatProviderProperty

RichTextBoxProperty

DependencyProperty

The rich text box property.

C#
public static readonly DependencyProperty RichTextBoxProperty

UpdateSourceTriggerProperty

DependencyProperty

The update source trigger property.

C#
public static readonly DependencyProperty UpdateSourceTriggerProperty

Properties

Gets or sets the ITextBasedDocumentFormatProvider that is used when converting the document.

C#
public ITextBasedDocumentFormatProvider FormatProvider { get; set; }

Gets or sets the RadRichTextBox this DataProvider is attached to.

C#
public RadRichTextBox RichTextBox { get; set; }

Gets or sets the string representing the document.

C#
protected string String { get; set; }
Property Value:

The string.

Gets or sets the update source trigger.

C#
public DataProviderUpdateSourceTrigger UpdateSourceTrigger { get; set; }
Property Value:

The update source trigger.

Methods

Binds the specified RadRichTextBox.

C#
protected virtual void Bind(RadRichTextBox radRichTextBox)
Parameters:radRichTextBoxRadRichTextBox

The RadRichTextBox.

Creates a custom string property.

C#
protected static DependencyProperty CreateStringProperty(string name)
Parameters:namestring

The name.

Returns:

DependencyProperty

Called after changing the attached data provider.

C#
public static void OnAttachedDataProviderPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
Parameters:dependencyObjectDependencyObject

The dependency object.

eDependencyPropertyChangedEventArgs

The DependencyPropertyChangedEventArgs instance containing the event data.

Raises the event.

C#
protected virtual void OnImportException(DataProviderImportExceptionEventArgs args)
Parameters:argsDataProviderImportExceptionEventArgs

The DataProviderImportExceptionEventArgs instance containing the event data.

Called when the data provider creates a new document.

C#
protected virtual void OnSetupDocument(RadDocument document)
Parameters:documentRadDocument

The document.

Called when the string associated to the provider is changed.

C#
protected virtual void OnStringChanged()

Sets the value respecting one way bindings.

C#
protected void SetValueRespectingOneWayBindings(string value)
Parameters:valuestring

The value.

A callback invoked when the associated string is changed.

C#
protected static void StringPropertyChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
Parameters:senderDependencyObject

The sender.

eDependencyPropertyChangedEventArgs

The DependencyPropertyChangedEventArgs instance containing the event data.

Unbinds the specified RadRichTextBox instance.

C#
protected virtual void Unbind(RadRichTextBox radRichTextBox)
Parameters:radRichTextBoxRadRichTextBox

The RadRichTextBox.

Updates the attached data provider.

C#
public static void UpdateAttachedDataProvider(DependencyObject dependencyObject, Func<RadRichTextBox, DataProviderBase> formatProviderFactory, Func<DependencyObject, DataProviderBase> getAttachedDataProvider, Action<DependencyObject, DataProviderBase> setAttachedDataProvider, DependencyProperty attachedDataProviderProperty, object newValue)
Parameters:dependencyObjectDependencyObject

The dependency object.

formatProviderFactoryFunc<RadRichTextBox, DataProviderBase>

The format provider factory.

getAttachedDataProviderFunc<DependencyObject, DataProviderBase>

A function that can get the attached to RadRichTextBox data provider.

setAttachedDataProviderAction<DependencyObject, DataProviderBase>

A function that can set the attached to RadRichTextBox data provider.

attachedDataProviderPropertyDependencyProperty

The attached data provider property.

newValueobject

The new value.

Updates the document inside the control.

C#
public virtual void UpdateDocument()

Updates the string representing the document.

C#
public virtual void UpdateString()

Events

Occurs when the import causes an exception.

C#
public event EventHandler<DataProviderImportExceptionEventArgs> ImportException

Occurs when the data provider creates a new document.

C#
public event EventHandler<SetupDocumentEventArgs> SetupDocument

Occurs after the string associated to the provider changes.

C#
protected event EventHandler StringChanged