DataProviderBase
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:
public class DataProviderBase : FrameworkElement
Inheritance: objectDataProviderBase
Derived Classes:
Constructors
Initializes a new instance of the DataProviderBase class.
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, DependencyProperty stringProperty)
The format provider.
stringPropertyDependencyPropertyThe string property.
Initializes a new instance of the DataProviderBase class.
public DataProviderBase(ITextBasedDocumentFormatProvider formatProvider, FrameworkElement propertyOwner, DependencyProperty stringProperty)
The format provider.
propertyOwnerFrameworkElementThe property owner.
stringPropertyDependencyPropertyThe string property.
Fields
FormatProviderProperty
DependencyProperty
The format provider property.
public static readonly DependencyProperty FormatProviderProperty
RichTextBoxProperty
DependencyProperty
The rich text box property.
public static readonly DependencyProperty RichTextBoxProperty
UpdateSourceTriggerProperty
DependencyProperty
The update source trigger property.
public static readonly DependencyProperty UpdateSourceTriggerProperty
Properties
Gets or sets the ITextBasedDocumentFormatProvider that is used when converting the document.
public ITextBasedDocumentFormatProvider FormatProvider { get; set; }
Gets or sets the RadRichTextBox this DataProvider is attached to.
public RadRichTextBox RichTextBox { get; set; }
Gets or sets the string representing the document.
protected string String { get; set; }
The string.
Gets or sets the update source trigger.
public DataProviderUpdateSourceTrigger UpdateSourceTrigger { get; set; }
The update source trigger.
Methods
Binds the specified RadRichTextBox.
protected virtual void Bind(RadRichTextBox radRichTextBox)
The RadRichTextBox.
Creates a custom string property.
protected static DependencyProperty CreateStringProperty(string name)
The name.
Returns:DependencyProperty
Called after changing the attached data provider.
public static void OnAttachedDataProviderPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
The dependency object.
eDependencyPropertyChangedEventArgsThe DependencyPropertyChangedEventArgs instance containing the event data.
Raises the event.
protected virtual void OnImportException(DataProviderImportExceptionEventArgs args)
The DataProviderImportExceptionEventArgs instance containing the event data.
Called when the data provider creates a new document.
protected virtual void OnSetupDocument(RadDocument document)
The document.
Called when the string associated to the provider is changed.
protected virtual void OnStringChanged()
Sets the value respecting one way bindings.
A callback invoked when the associated string is changed.
protected static void StringPropertyChangedCallback(DependencyObject sender, DependencyPropertyChangedEventArgs e)
The sender.
eDependencyPropertyChangedEventArgsThe DependencyPropertyChangedEventArgs instance containing the event data.
Unbinds the specified RadRichTextBox instance.
protected virtual void Unbind(RadRichTextBox radRichTextBox)
The RadRichTextBox.
Updates the attached data provider.
public static void UpdateAttachedDataProvider(DependencyObject dependencyObject, Func<RadRichTextBox, DataProviderBase> formatProviderFactory, Func<DependencyObject, DataProviderBase> getAttachedDataProvider, Action<DependencyObject, DataProviderBase> setAttachedDataProvider, DependencyProperty attachedDataProviderProperty, object newValue)
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.
attachedDataProviderPropertyDependencyPropertyThe attached data provider property.
newValueobjectThe new value.
Updates the document inside the control.
public virtual void UpdateDocument()
Updates the string representing the document.
public virtual void UpdateString()
Events
Occurs when the import causes an exception.
public event EventHandler<DataProviderImportExceptionEventArgs> ImportException
Occurs when the data provider creates a new document.
public event EventHandler<SetupDocumentEventArgs> SetupDocument
Occurs after the string associated to the provider changes.
protected event EventHandler StringChanged