开发者

WPF: Partial data binding in TextBlock

So here is my TextBlock:

<TextBlock Text="1 Projects开发者_开发技巧 / 1 Issues"></TextBlock>

Using data binding I want replace 1 and 2 with {Binding Path=OpenProjects} and {Binding Path=OpenIssues}. What is the best way to do this?

P.S. I am not married to TextBlock.


<TextBlock>
  <TextBlock.Text>
    <MultiBinding StringFormat="{}{0} Projects / {1} Issues">
      <Binding Path="OpenProjects"/>
      <Binding Path="OpenIssues"/>
    </MultiBinding>
  </TextBlock.Text>
</TextBlock>


You should look into string format

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜