<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Bindable WPF RichText Editor with XAML/HTML Convertor</title>
	<atom:link href="http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor</link>
	<description>Sharing our knowledge</description>
	<lastBuildDate>Thu, 19 Jan 2012 06:22:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: giocaputo</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-322148</link>
		<dc:creator>giocaputo</dc:creator>
		<pubDate>Wed, 10 Aug 2011 12:49:06 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-322148</guid>
		<description>It resolved setting only width propery to richtextbox control. For example 
</description>
		<content:encoded><![CDATA[<p>It resolved setting only width propery to richtextbox control. For example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NL</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-319695</link>
		<dc:creator>NL</dc:creator>
		<pubDate>Fri, 29 Jul 2011 22:08:45 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-319695</guid>
		<description>How to highlight option to tool bar, so that users can add color to text ?</description>
		<content:encoded><![CDATA[<p>How to highlight option to tool bar, so that users can add color to text ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PB from internet marketing</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-309366</link>
		<dc:creator>PB from internet marketing</dc:creator>
		<pubDate>Mon, 13 Jun 2011 11:38:09 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-309366</guid>
		<description>Thanks so much for all of your work.</description>
		<content:encoded><![CDATA[<p>Thanks so much for all of your work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Lagunas</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-280718</link>
		<dc:creator>Brian Lagunas</dc:creator>
		<pubDate>Mon, 07 Feb 2011 18:58:43 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-280718</guid>
		<description>This is a nice post, but you could save yourself some time and just use the RichTextBox in the Extended WPF Toolkit.  It has all this functionality built into it, minus the HTML Conversion.  But you can create your own custom ITextFormatter using the code in this article.  There is also a RichTextBoxFormatBar which mimics MS Office contextual format bar.

wpftoolkit.codeplex.com</description>
		<content:encoded><![CDATA[<p>This is a nice post, but you could save yourself some time and just use the RichTextBox in the Extended WPF Toolkit.  It has all this functionality built into it, minus the HTML Conversion.  But you can create your own custom ITextFormatter using the code in this article.  There is also a RichTextBoxFormatBar which mimics MS Office contextual format bar.</p>
<p>wpftoolkit.codeplex.com</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sarah</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-266838</link>
		<dc:creator>Sarah</dc:creator>
		<pubDate>Mon, 13 Dec 2010 17:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-266838</guid>
		<description>Looks like FlowDocument doc = new FlowDocument() in OnBoundDocumentChanged() is never used.</description>
		<content:encoded><![CDATA[<p>Looks like FlowDocument doc = new FlowDocument() in OnBoundDocumentChanged() is never used.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Loïc Joly</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-242126</link>
		<dc:creator>Loïc Joly</dc:creator>
		<pubDate>Wed, 28 Jul 2010 14:13:57 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-242126</guid>
		<description>Hello,

I struggled with the HandleTextChanged a little bit, and found this solution (the rest is unchanged):

		private static void OnDocumentTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			
			RichTextBox box = d as RichTextBox;
			if (box == null)
				return;

			if (ignoredTextBoxes.Contains(box))
			{
				return;
			}
                        // Just as before...
		}

		private static void HandleTextChanged(object sender, RoutedEventArgs e)
		{
			RichTextBox box = sender as RichTextBox;
			TextRange tr = new TextRange(box.Document.ContentStart,	box.Document.ContentEnd);

			using (MemoryStream ms = new MemoryStream())
			{
				tr.Save(ms, DataFormats.Xaml);
				string xamlText = UTF8Encoding.Default.GetString(ms.ToArray());
				ignoredTextBoxes.Add(box);
				SetDocumentText(box, xamlText);
				ignoredTextBoxes.Remove(box);
			}

		}

		static HashSet ignoredTextBoxes = new HashSet();</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I struggled with the HandleTextChanged a little bit, and found this solution (the rest is unchanged):</p>
<p>		private static void OnDocumentTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)<br />
		{</p>
<p>			RichTextBox box = d as RichTextBox;<br />
			if (box == null)<br />
				return;</p>
<p>			if (ignoredTextBoxes.Contains(box))<br />
			{<br />
				return;<br />
			}<br />
                        // Just as before&#8230;<br />
		}</p>
<p>		private static void HandleTextChanged(object sender, RoutedEventArgs e)<br />
		{<br />
			RichTextBox box = sender as RichTextBox;<br />
			TextRange tr = new TextRange(box.Document.ContentStart,	box.Document.ContentEnd);</p>
<p>			using (MemoryStream ms = new MemoryStream())<br />
			{<br />
				tr.Save(ms, DataFormats.Xaml);<br />
				string xamlText = UTF8Encoding.Default.GetString(ms.ToArray());<br />
				ignoredTextBoxes.Add(box);<br />
				SetDocumentText(box, xamlText);<br />
				ignoredTextBoxes.Remove(box);<br />
			}</p>
<p>		}</p>
<p>		static HashSet ignoredTextBoxes = new HashSet();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Eddington</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-239547</link>
		<dc:creator>Martin Eddington</dc:creator>
		<pubDate>Wed, 07 Jul 2010 10:56:15 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-239547</guid>
		<description>Sorry, WordPress doesn&#039;t like this code - enclose it in open and close XML tags...

FlowDocument PageWidth=&quot;{Binding ElementName=mainRTB, Path=ActualWidth}&quot;</description>
		<content:encoded><![CDATA[<p>Sorry, WordPress doesn&#8217;t like this code &#8211; enclose it in open and close XML tags&#8230;</p>
<p>FlowDocument PageWidth=&#8221;{Binding ElementName=mainRTB, Path=ActualWidth}&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Eddington</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-239545</link>
		<dc:creator>Martin Eddington</dc:creator>
		<pubDate>Wed, 07 Jul 2010 10:53:19 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-239545</guid>
		<description>Hi, just to say the problem with the text flowing downwards, not across is caused by placing the control within other controls which need to know the width of their children. Wrapping it in a scrollviewer or other controls is an incomplete fix for more complex scenarios.

The way to fix it is to bind the internal Flowdocument in the RichTextBox to the width of the RichTextBox.

e.g.

            
        

I&#039;m currently driving myself insane trying to make the TextChanged property work correctly... I&#039;ll post again if I fix it.</description>
		<content:encoded><![CDATA[<p>Hi, just to say the problem with the text flowing downwards, not across is caused by placing the control within other controls which need to know the width of their children. Wrapping it in a scrollviewer or other controls is an incomplete fix for more complex scenarios.</p>
<p>The way to fix it is to bind the internal Flowdocument in the RichTextBox to the width of the RichTextBox.</p>
<p>e.g.</p>
<p>I&#8217;m currently driving myself insane trying to make the TextChanged property work correctly&#8230; I&#8217;ll post again if I fix it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Julian Dominguez</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-230980</link>
		<dc:creator>Julian Dominguez</dc:creator>
		<pubDate>Tue, 11 May 2010 13:07:34 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-230980</guid>
		<description>Hi Mike, great article. The XAML2HTML converter from the SDK is rather rough and looses a lot of quality. Did you get a chance to update it and fix some of its issues? I&#039;d love to see it improved!</description>
		<content:encoded><![CDATA[<p>Hi Mike, great article. The XAML2HTML converter from the SDK is rather rough and looses a lot of quality. Did you get a chance to update it and fix some of its issues? I&#8217;d love to see it improved!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt Penner</title>
		<link>http://michaelsync.net/2009/06/09/bindable-wpf-richtext-editor-with-xamlhtml-convertor/comment-page-1#comment-223544</link>
		<dc:creator>Matt Penner</dc:creator>
		<pubDate>Sat, 10 Apr 2010 08:51:16 +0000</pubDate>
		<guid isPermaLink="false">http://michaelsync.net/?p=1397#comment-223544</guid>
		<description>I&#039;m trying your code but for some reason the text that is bound always is displayed without any formatting.  I&#039;m not using your RichTextEditor control but rather just the attached property (and its dependencies).  All I&#039;m really trying to do is display formatted text.  It is not going to be editable.

I have html tags in the text yet they are simply stripped out.  They aren&#039;t even displayed.  So &quot;&lt;b&gt;this should be bold&lt;/b&gt;&quot; simply comes out as &quot;this should be bold&quot;.

I&#039;m not sure what I am missing.

Unfortunately I cannot run your code becuase I don&#039;t have VS 2010 or .Net 4 installed.

I tried loading your files into a VS 2008 project but I&#039;m getting weird errors that I can&#039;t figure out.

Anyway, if you could let me know why my bound text is not getting formatted I would appreciate it.

Thanks,
Matt</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying your code but for some reason the text that is bound always is displayed without any formatting.  I&#8217;m not using your RichTextEditor control but rather just the attached property (and its dependencies).  All I&#8217;m really trying to do is display formatted text.  It is not going to be editable.</p>
<p>I have html tags in the text yet they are simply stripped out.  They aren&#8217;t even displayed.  So &#8220;<b>this should be bold</b>&#8221; simply comes out as &#8220;this should be bold&#8221;.</p>
<p>I&#8217;m not sure what I am missing.</p>
<p>Unfortunately I cannot run your code becuase I don&#8217;t have VS 2010 or .Net 4 installed.</p>
<p>I tried loading your files into a VS 2008 project but I&#8217;m getting weird errors that I can&#8217;t figure out.</p>
<p>Anyway, if you could let me know why my bound text is not getting formatted I would appreciate it.</p>
<p>Thanks,<br />
Matt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

