【问题标题】:MVVM- How can I bind to a textbox's SelectionStart and SelectionLength properties?MVVM-如何绑定到文本框的 SelectionStart 和 SelectionLength 属性?
【发布时间】:2011-02-06 20:07:28
【问题描述】:

最好的方法是什么?

【问题讨论】:

标签: wpf data-binding mvvm c#-4.0


【解决方案1】:

以下 - “How to bind SelectionStart Property of Text Box?”提出了类似的问题,并正确指出 SelectionStart 不能绑定到它不是依赖属性(这对于 SelectionLength 也是如此)。进一步向下提供了一些解决方法;一个使用自定义文本框(这是我的偏好),另一个使用附加行为。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-11-13
    • 2012-02-29
    • 2011-09-03
    • 2020-08-12
    • 2023-04-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多