Selecting all the text

May 31, 2012 at 3:39 PM

I have noticed that after formatting a selection when I bring the mouse back into the editing window all the text gets selected. 

How do I stop that?

 

Jun 12, 2012 at 7:46 PM

I fixed it.

 

Here is the new code.

 

private static void OnBindingContentChanged(object sender, DependencyPropertyChangedEventArgs e)
		{
			HtmlEditor editor = (HtmlEditor)sender;
			string existingHTML = editor.ContentHtml;
			string newHTML = (string)e.NewValue;
			if (newHTML != existingHTML)
			{
				editor.myBindingContent = newHTML;
				editor.ContentHtml = editor.myBindingContent;
			}
		}
You need to check that the new value is different from the old before setting it.