你好,感谢您的帮助。我有一个Treeview,我用一个Hierarchical数据模板填充,并且当前最底层的节点有一个工具提示,它生成一个小堆栈面板,其中填充了鼠标悬停的项目的特定数据。我也有一个坐在工具提示中的按钮,但是,当鼠标移过它时,工具提示不会持续,我无法使用像我需要的那样的按钮。我的XAML看起来像这样:Silverlight工具提示保持与鼠标悬停可见
<!--=========================== 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>
我想提示坚持上方时鼠标移动,这样我可以电汇事件的按钮。我怎样才能做到这一点?再次感谢您的帮助。
对于我自己的薰陶,当鼠标移过它时,“坚持”是什么意思?听起来就像你只需要一个ToolTip.Template而不是设置内容。 :/ – 2012-08-15 21:38:52
我只需要它在鼠标指针从treeView项移动到工具提示框本身时保持可见状态,以便在此情况下使用按钮进行交互是可能的。你能通过工具提示模板影响吗? – Christian 2012-08-15 22:25:26