Binding the content of a Span

前端 未结 1 907
花落未央
花落未央 2021-02-20 02:49

I have a window that displays text. There are two parts to the text: the first is fixed while the second needs to be the content of a DependencyProperty declared on the window.

相关标签:
1条回答
  • 2021-02-20 03:14

    If you're using .NET 4:

    <TextBlock>
        <Run Text="Fixed:"/>
        <Run Text="{Binding Variable}"/>
    </TextBlock>
    

    Prior to .NET 4, the Run's Text property was not a dependency property.

    0 讨论(0)
提交回复
热议问题