views:

118

answers:

1

Hello,

I want to bind one property 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?

+4  A: 

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>
Taylor Leese
+1 Correct answer.
Danny Varod
thank you very much, exactly what i was looking for. i obviously used the wrong search terms.
stefan.at.wpf