I have an abstract UserControl
that I want to show a ToolTip
on. This ToolTip
should be different based on the Type of the DataContext which is defined in the derived UserControls.
Is there a way to define a different ToolTip
for each type in the base class? If not, how can I set this ToolTip in the derived UserControl?
Here is how I thought I would go:
<UserControl ...
<UserControl.ToolTip>
<DataTemplate DataType="{x:Type Library:Event}">
<StackPanel>
<TextBlock FontWeight="Bold" Text="{Binding Name}" />
<TextBlock>
<TextBlock.Text>
<Binding Path="Kp" StringFormat="{}Kp: {0}m" />
</TextBlock.Text>
</TextBlock>
</StackPanel>
</DataTemplate>
</UserControl.ToolTip>
</UserControl>