Everything SharePoint and XAML

My continuous learning of SharePoint, XAML, Silverlight, Windows Phone 7, Windows 8, Office, VSTO, C#…

Archive for January 13th, 2010

Silverlight: Tooltip for each ListBox item

Posted by Steve Pietrek on January 13, 2010

Below is a code example of defining a tooltip for each ListBox item.

<ListBox.ItemTemplate>
 <DataTemplate>
  <StackPanel>
   <ToolTipService.ToolTip>
    <ToolTip>
     <TextBlock Text="{Binding Summary}" Style="{StaticResource TooltipFont}"/>
    </ToolTip>
   </ToolTipService.ToolTip>
   <HyperlinkButton NavigateUri="{Binding DisplayLinkUrl}" TargetName="_blank" BorderThickness="0">
    <TextBlock Text="{Binding Published, Converter={StaticResource ShortDateConverter}}" Style="{StaticResource TitleFont}"/>
   </HyperlinkButton>
   <TextBlock Text="{Binding TruncSummary}" Style="{StaticResource SummaryFont}"/>
  </StackPanel>
 </DataTemplate>
</ListBox.ItemTemplate>

Posted in Silverlight | Comments Off

 
Follow

Get every new post delivered to your Inbox.