//convert
public class CanBeAppliedDisplayConverter : IMultiValueConverter
{}
//viewmodel
public class viewmodel : INotifyPropertyChanged
{
private string _name1;
public string name1
{
get { return _name1; }
set
{
_name1 = value;
OnPropertyChanged("name1");
}
}
private string _name2;
public string name2
{
get { return _name2; }
set
{
_name2 = value;
OnPropertyChanged("name2");
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
//xaml
<TextBlock DataContext="{Binding}">
<TextBlock.ToolTip>
<ToolTip >
<TextBlock DataContext="{Binding}">
<TextBlock.Text>
<MultiBinding Converter="{StaticResource CanBeAppliedDisplayConverter}">
<Binding Path="name1" />
<Binding Path="name2" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>