我有一个只读属性,我需要在文本框中显示,并在运行时收到此错误.我已经定了IsEnabled="False",IsReadOnly="True"- 没有运气.其他搜索说,readonly应该修复它,但不适合我.通过添加虚拟设置器我有一个丑陋的解决方法......
Raz*_*zie 156
没有代码很难猜测,但你应该能够将BindingMode设置为OneWay.
<TextBox Text="{Binding Path=MyProperty, Mode=OneWay}" />
Run Code Online (Sandbox Code Playgroud)
或者来自代码:
Binding binding = new Binding();
binding.Mode = BindingMode.OneWay;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
47967 次 |
| 最近记录: |