If the ToolTip is binded to the data operations takes a long time, the UI thread is blocked. Is it possible to solve this problem? The ToolTip should be shown optimal on idle and asynchronous.
You can see the effect in the following example.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:io="clr-namespace:System.IO;assembly=mscorlib"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<ObjectDataProvider x:Key="FileSystemItems" MethodName="GetFiles" ObjectType="{x:Type io:DirectoryInfo}">
<ObjectDataProvider.ConstructorParameters>
<system:String>c:\windows\System32</system:String>
</ObjectDataProvider.ConstructorParameters>
</ObjectDataProvider>
<ToolTip x:Key="ListViewItemToolTip">
<ItemsControl Height="200" Margin="4,0,4,4" ItemsSource="{Binding Source={StaticResource FileSystemItems}}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<TextBlock Margin="12,0,0,0" FontWeight="Bold" Text="{Binding Path=FullName}"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ToolTip>
</Page.Resources>
<Grid>
<ListView IsSynchronizedWithCurrentItem="True" ItemsSource="{x:Static Fonts.SystemFontFamilies}" SelectionMode="Single">
<ListView.ItemContainerStyle>
<Style TargetType="ListViewItem">
<Setter Property="ToolTip" Value="{Binding Source={StaticResource ListViewItemToolTip}, IsAsync=True}"/>
<Setter Property="ToolTipService.ShowDuration" Value="60000"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.View>
<GridView>
<GridViewColumn DisplayMemberBinding="{Binding Source}" Header="Name"/>
<GridViewColumn Header="Sample">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock FontFamily="{Binding}" Text="The quick brown fox jumps over the lazy dog"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</Grid>
</Page>
You can change the path to compare the performance.