Skip to content

[Feature] Conditional tooltip attached property #4199

@dpaulino

Description

@dpaulino

Describe the problem this feature would solve

When developing my UWP apps, there are times when I only want to show a tooltip based on certain conditions. For example, if I have a textblock, I normally don't want to show any tooltip. But if the textblock gets trimmed for some reason (such as when user switches to 225% text scale for a11y), then I want the textblock to show a tooltip. So this conditional tooltip attached property will address that issue.

Describe the solution

For the new Microsoft Store app, I created an attached property for a conditional tooltip. It exposes an IsTooltipEnabled bool property and a custom TooltipContent property. The bool controls whether or not the tooltip is enabled, and developers can use xBind and OneWay mode to update that property on the fly. This attached property works on basically anything, much like the built-in ToolTipService works on anything. I would love to bring this attached property to the toolkit so that other apps (such as my personal apps) can use this.

Describe alternatives you've considered

Additional context & Screenshots

I will be happy to create a draft PR for this once I get the green light from the toolkit team!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions