Reputation: 1525
I have a Application that displays some ContentControls on a Kind of Desktop.
Now I want to show Tooltips on these Controls. But the Tooltip is changing from time to time and the Text for the Tooltip is coming from outside the Application. So I need something like a callback to when the Hint appears and than ask the outside part for the Text to display.
How can one do that?
Upvotes: 0
Views: 49
Reputation: 24453
If you use data binding for your ToolTip you can fetch the new outside data from the bound property and it will be updated every time the ToolTip is shown. XAML would look like this:
<ContentControl ToolTip="{Binding MyExternalDataProperty}"/>
for a DataContext object set up like this:
public class DataContextForControl
{
public string MyExternalDataProperty
{
get { return MyOutsideDataReader.SomeData; }
}
}
Upvotes: 3