Hi
I have the following code which I am using to bind to the RichTextBox, but the actual HTML from the HtmlDataProvider is not updated at the time that the DocumentContentChanged event is fired. How can I force this update or is there an event that I can attach to that is fired after the HtmlDataProvider html is updated.
I have the following code which I am using to bind to the RichTextBox, but the actual HTML from the HtmlDataProvider is not updated at the time that the DocumentContentChanged event is fired. How can I force this update or is there an event that I can attach to that is fired after the HtmlDataProvider html is updated.
public
string
HtmlString
{
get
{
return
(
string
)
this
.GetValue(HtmlStringProperty); }
set
{
this
.SetValue(HtmlStringProperty, value);
}
}
public
static
readonly
DependencyProperty HtmlStringProperty = DependencyProperty.Register(
"HtmlString"
,
typeof
(
string
),
typeof
(RichTextEditorUC),
new
PropertyMetadata(
null
, OnHtmlStringChanged));
private
static
void
OnHtmlStringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
RichTextEditorUC parent = d
as
RichTextEditorUC;
if
(e.NewValue !=
null
)
if
(parent.htmlDataProvider.Html != e.NewValue
as
string
)
parent.htmlDataProvider.Html = e.NewValue
as
string
;
}
private
void
editor_DocumentContentChanged(
object
sender, System.EventArgs e)
{
this
.htmlDataProvider.UpdateDocument();
this
.HtmlString =
this
.htmlDataProvider.Html;
}