What would be the best way to do this?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The following - "How to bind SelectionStart Property of Text Box?", asks a similar question and correctly indicates that SelectionStart cannot be bound to is it is not a dependency property (and this is true for SelectionLength as well). Further down a couple of work-arounds have been provided; one using custom textbox (this would be my preference), and another using attached behaviours.