Wednesday, August 15, 2012

Silverlight Tooltip Remain Visible With Mouseover

Silverlight Tooltip Remain Visible With Mouseover

Hello and thanks for the help. I have a Treeview that I am populating with a Hierarchical data template, and currently the bottom nodes have a tooltip that generates a small stack panel that is populated with data specific to the item the mouse hovers over. I also have a button sitting in the tooltip, however, as the tooltip does not persist when the mouse moves over it, I am unable to make use of the button like I need to. My xaml looks like this:

<!--===========================  Hierarchical Data template  for tree view -->                         <!--template for bottom nodes-->                         <sdk:HierarchicalDataTemplate x:Key="ModTemplate" ItemsSource="{Binding ApplicationModules}">                             <StackPanel Orientation="Horizontal" >                            <!--======tooltip style to handle format for callout window============-->                                 <ToolTipService.ToolTip>                                     <ToolTip  HorizontalOffset="0" VerticalOffset="0" Style="{StaticResource ModuleToolTipStyle}">                                          <StackPanel Width="150" Height="auto" >                              <TextBlock Text="Module Info" FontWeight="Bold" TextAlignment="Center"/>                                             <TextBlock Text="Module State:" FontWeight="Bold" />                                             <TextBlock Text="{Binding Path=ModInfo.ModuleState}" />                                             <TextBlock Text="Module Start Time:" FontWeight="Bold" />                                             <TextBlock Text="{Binding Path=ModInfo.ModuleStartTime}"/>                                             <TextBlock Text="Module Down Time:" FontWeight="Bold"/>                                             <TextBlock Text="{Binding Path=ModInfo.ModuleDownTime}" />                                             <Button Content="More Info" Width="75"></Button>                                         </StackPanel>                                      </ToolTip>                                 </ToolTipService.ToolTip>                <!--============end tooltip style for callout window===================-->                                  <ContentPresenter Margin="0 0 4 0" Content="{Binding Icon}" />                                 <TextBlock FontStyle="Italic" Text="{Binding Path=ModuleName}" />                             </StackPanel>                         </sdk:HierarchicalDataTemplate> 

I would like the tooltip to persist when the mouse moves over it so that I can wire an event to the button. How can I achieve this? Thanks again for the help.

Answers & Comments...




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog