Two Way Binding to AvalonEdit Document Text using MVVM
Create a Behavior class that will attach the TextChanged event and will hook up the dependency property that is bound to the ViewModel. AvalonTextBehavior.cs public sealed class AvalonEditBehaviour : Behavior<TextEditor> { public static readonly DependencyProperty GiveMeTheTextProperty = DependencyProperty.Register(“GiveMeTheText”, typeof(string), typeof(AvalonEditBehaviour), new FrameworkPropertyMetadata(default(string), FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, PropertyChangedCallback)); public string GiveMeTheText { get { return (string)GetValue(GiveMeTheTextProperty); } set { … Read more