I would like to ask, if it is possible to use property from ViewModel in different attribute than for example ItemSource and so on. Example explains the best:
<TextBlock Text="{Binding Name, Mode=TwoWay}" Grid.Column="1">
<TextBlock.ToolTip>
<Image VerticalAlignment="Top" Width="auto" Height="auto" Source="Images/Doc/SomeImage.png"/>
</TextBlock.ToolTip>
</TextBlock>
In this code I would like to use Name (which is used in first line in Binding) as a name of the image - instead of "SomeImage". The purpose of whole this is, that it is item of TreeView and I need to have image for each TextBlock in ToolTip dynamically, based on Name of the item.
So some naive solution will be something like this:
<TextBlock Text="{Binding Name, Mode=TwoWay}" Grid.Column="1">
<TextBlock.ToolTip>
<Image VerticalAlignment="Top" Width="auto" Height="auto" Source="Images/Doc/{Binding Name}.png"/>
</TextBlock.ToolTip>
</TextBlock>
I am searching for solution, how to do it in XAML only, with not touching code behind. If it is even possible?
Thanks a lot for any hint!