/// <summary> /// Creates a new TextEditor instance. /// </summary> protected TextEditor(TextArea textArea) { if (textArea == null) throw new ArgumentNullException("textArea"); this.textArea = textArea; textArea.TextView.Services.AddService(typeof(TextEditor), this); this.Options = textArea.Options; this.Document = new TextDocument(); textArea.SetBinding(TextArea.DocumentProperty, new Binding(DocumentProperty.Name) { Source = this }); textArea.SetBinding(TextArea.OptionsProperty, new Binding(OptionsProperty.Name) { Source = this }); }