【发布时间】:2010-09-02 01:00:33
【问题描述】:
我正在尝试在我的用户控件中轻松绑定:
<UserControl x:Class="MyApp.FlowNode" ...>
<StackPanel>
<Label Content="{Binding Path=Header, RelativeSource={RelativeSource Self}}" />
</StackPanel>
</UserControl>
底层代码为:
public partial class FlowNode : UserControl
{
public FlowNode()
{
InitializeComponent();
}
public string Header { get { return "Testing"; } };
}
但是,标签保持空白。我做错了什么?
【问题讨论】: