I have achieved my goals.
Sheridan's answer and comments help me.
I have updated my sample project.
The ToolTip is now shown just above the TextBlock when the Button is clicked.
And a Timer's callback method closes the ToolTip after a constant amount of time equal to 2500 ms.
Here is the updated main Window's XAML markup :
<Window x:Class="ToolTipSample.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525"
WindowState="Maximized">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Button Click="OnButtonClick">Show ToolTip</Button>
<StatusBar Grid.Row="2">
<StatusBarItem>
<TextBlock Width="900" />
</StatusBarItem>
<StatusBarItem>
<TextBlock x:Name="m_statusMessage" Text="TextBlock With ToolTip" ToolTipService.ShowDuration="30000">
<TextBlock.ToolTip>
<ToolTip x:Name="m_toolTip" Placement="Top">
<TextBlock>
ToolTip ToolTipToolTipToolTipToolTipToo lTipToolTipToolTipT oolTipToolTipT
<LineBreak />
oolTipToolTi pToolTipToo lTipToolTipToolTipToolTipToolTipTo olTipToolTipToolTipTool
<LineBreak />
TipToo lTipToolTipToolTipToo lTipToolTipTo olTipToolTip
</TextBlock>
</ToolTip>
</TextBlock.ToolTip>
</TextBlock>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>
Here is the updated main Window's code-behind without the using statements :
namespace ToolTipSample
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private Timer m_toolTipClosingTimer;
public MainWindow()
{
InitializeComponent();
m_toolTipClosingTimer = new Timer(ToolTipClosingCallBack, null, Timeout.Infinite, Timeout.Infinite);
}
private void OnButtonClick(object p_sender, RoutedEventArgs p_args)
{
m_toolTip.PlacementTarget = m_statusMessage;
m_toolTip.IsOpen = true;
m_toolTipClosingTimer.Change(2500, Timeout.Infinite);
}
private void ToolTipClosingCallBack(object p_useless)
{
Dispatcher.Invoke(() =>
{
m_toolTip.IsOpen = false;
});
}
}
}