【问题标题】:Tooltip not showing in Hearthstone Decktracker plugin工具提示未显示在《炉石传说》Decktracker 插件中
【发布时间】:2019-07-24 10:33:31
【问题描述】:

我正在为 Hearthstone Decktracker 编写一个插件,并且正在为 ItemsControl 中生成的每个项目添加一个工具提示。

如果我将调试器附加到 HearthstoneDeckTracker,我可以看到项目在 VisualTree 中有一个工具提示,但是当我将鼠标悬停在项目上时,工具提示永远不会显示。

如果有人能够帮助解决这个问题,则需要他们拥有 HDT 和炉石传说,但我觉得这个问题更多的是 WPF 问题而不是 DeckTracker 问题。

https://github.com/HearthSim/Hearthstone-Deck-Tracker/wiki/Creating-Plugins有创建插件的说明

要复制此内容,您可以使用 HDT Github 在https://github.com/andburn/hdt-plugin-example 提供的示例项目。

在 CurvyList.xaml 中的 DataTemplate 中添加工具提示应该能够向您展示我所看到的。

代替


    <DataTemplate>
        <Rectangle Fill="{Binding Background}" Height="34" Width="217" />
    </DataTemplate>

你会的(对不起......这样做是我的头脑,所以语法可能不正确)

        <DataTemplate>
            <Rectangle Fill="{Binding Background}" Height="34" Width="217" >
                <Rectangle.Tooltip>
                   <Textblock Text="Hello World" />
                </Rectangle.Tooltip>
            </Rectangle>
        </DataTemplate>

我已经在 Discord 官方频道上发布了同样的问题,但我认为它目前没有被查看,所以我将在这里试一试。

任何帮助将不胜感激!提前致谢。

【问题讨论】:

    标签: wpf plugins


    【解决方案1】:

    您不能直接将tooltip 添加到矩形中吗?

    <DataTemplate>
        <Rectangle Fill="{Binding Background}" ToolTip="Hello World" Height="34" Width="217" />
    </DataTemplate>
    

    【讨论】:

    • 感谢您的回复。您可以将工具提示添加到矩形,但存在同样的问题(最终,我想创建一个更复杂的工具提示)......我认为这与 DeckTracker 显示插件的方式有关......有点像就像 hittest 没有找到应用工具提示的项目一样。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多