MVVM and the TextBox’s SelectedText property
There’s no straightforward way to bind SelectedText to a data source, because it’s not a DependencyProperty… however, it quite easy to create an attached property that you could bind instead. Here’s a basic implementation : public static class TextBoxHelper { public static string GetSelectedText(DependencyObject obj) { return (string)obj.GetValue(SelectedTextProperty); } public static void SetSelectedText(DependencyObject obj, string … Read more