开发者

Data Binding: multiple sources for one property

开发者 https://www.devze.com 2022-12-26 07:44 出处:网络
I want to bind one prop开发者_StackOverflowerty to multiple sources. My reason for this are things like this:

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

精彩评论

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

关注公众号