-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding conditional tooltip class #4202
base: main
Are you sure you want to change the base?
Adding conditional tooltip class #4202
Conversation
Thanks dpaulino for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems straight-forward enough, provided a couple of suggestions to integrate with the Toolkit repo. Then a sample page can be handy. Trying to think if I've tried to set anything other than a string to a Tooltip and what's happened... can you just use a TextBlock element to get fancy formatting?
Added this to the next milestone as we've closed out features for 7.1.
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
namespace Microsoft.Toolkit.Uwp.UI.Extensions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We started flattening our namespace, so all extensions moved to just be in the UI
domain.
/// Provides attached dependency properties that allow a <see cref="UIElement"/> | ||
/// to conditionally enable or disable its tooltip. | ||
/// </summary> | ||
public class ConditionalToolTip : DependencyObject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can just be a partial class off our existing UIElementExtensions
class, it doesn't need to be its own DependencyObject
.
@dpaulino is this something you still wanted to clean-up and contribute? |
Yes! sorry I've been busy outside work and forgot this. I'll try to get to it this weekend |
Fixes
Fixes #4199.
This feature adds an attached property that can conditionally enable or disable a tooltip. This is useful for a11y scenarios, such as when a textblock gets trimmed due to 225% text scale, this conditional tooltip can be activated when the target element is trimmed. Thus, a tooltip would be shown only when the textblock is trimmed.
PR Type
What kind of change does this PR introduce?
What is the current behavior?
None
What is the new behavior?
New feature
PR Checklist
Please check if your PR fulfills the following requirements:
Other information