开发者

Data Binding: multiple sources for one property

I want to bind one prop开发者_StackOverflowerty to multiple sources. My reason for this are things like this:

midpoint=point2.X - point1.X; //depends on two sources!

How could this be realised? As far as I know it's not directly possible out-of-the-box?


I believe what you are looking for is a MultiBinding.

From the MSDN documentation:

<TextBlock Name="textBox2" DataContext="{StaticResource NameListData}">
  <TextBlock.Text>
    <MultiBinding Converter="{StaticResource myNameConverter}"
                  ConverterParameter="FormatLastFirst">
      <Binding Path="FirstName"/>
      <Binding Path="LastName"/>
    </MultiBinding>
  </TextBlock.Text>
</TextBlock>
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜