MVVM-如何绑定到文本框的SelectionStart和SelectionLength属性? [英] MVVM- How can I bind to a textbox's SelectionStart and SelectionLength properties?

查看:733
本文介绍了MVVM-如何绑定到文本框的SelectionStart和SelectionLength属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是最好的方法是什么?

What would be the best way to do this?

推荐答案

以下 - 如何绑定TextBox的SelectionStart属性?,请求类似的问题,并正确地指示 SelectionStart 不能绑定到它是不是依赖属性(这也适用于 SelectionLength )。进一步提供了几个解决方法;一个使用自定义文本框(这将是我的首选项),另一个使用附加的行为。

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.

这篇关于MVVM-如何绑定到文本框的SelectionStart和SelectionLength属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆