<Window.Resources>
<local:MyMultiValueConverter x:Key="mc" />
</Window.Resources>
...
<TextBox Height="21" Margin="79,87,79,0" Name="textBox1" VerticalAlignment="Top">
<TextBox.Text>
<MultiBinding Converter="{StaticResource mc}" Mode="OneWay">
<Binding ElementName="win1" Path="."/>
<Binding ElementName="win1" Path="Title"/>
</MultiBinding>
</TextBox.Text>
</TextBox>
public class MyMultiValueConverter : IMultiValueConverter
{
public object Convert (object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Window win = values[0] as Window;
Button btn = win.FindName("button1") as Button;
string title=values[1].ToString();
if (btn == null)
return title;
else
return btn.Content.ToString() + " " + title;
}
public object[] ConvertBack (object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}