【发布时间】:2010-12-19 02:59:19
【问题描述】:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DataContext="This is my text">
<TextBlock>
<Run Text="{Binding}"/>
</TextBlock>
</Window>
抛出 InvalidOperationException:“双向绑定需要 Path 或 XPath。”
指定Mode=OneWay,会导致奇怪的编译器错误:
The tag 'Binding,' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.
有什么方法可以解决这个问题吗?
【问题讨论】:
标签: wpf binding textblock bindable