I am looking for RichTextBox and FlowDocument sources.
I have TextEditor inherited from RichTextBox
Properties overlap with this line:
DefaultStyleKeyProperty.OverrideMetadata(typeof(TextEditor), new FrameworkPropertyMetadata(typeof(TextEditor))); .
public class TextEditor : RichTextBox static TextEditor() { DefaultStyleKeyProperty.OverrideMetadata(typeof(TextEditor), new FrameworkPropertyMetadata(typeof(TextEditor))); If you commit it, the controller works as a RichTextBox.
But the TextEditor properties do not work.
Without commenting - the controller works as TextEditor. But you can not insert pictures into it.
Partially an example of my code here: How to insert a picture into a RichTextBox?
public class TextEditor : RichTextBox public sealed class TextDocument : FlowDocument