我如何将TextBlock绑定到richtextbox的第一行?
提前致谢。
答案 0 :(得分:0)
<FlowDocument>
<Paragraph>
<TextBlock Text="{Binding FirstLine}"/>
</Paragraph>
</FlowDocument>
构造
DataContext = this;
public static readonly DependencyProperty FirstLineProperty =
DependencyProperty.Register("FirstLine", typeof(string), typeof(CLASS));
public string FirstLine
{
get { return (string)GetValue(FirstLineProperty); }
set { SetValue(FirstLineProperty, value); }
}