microsoft-ui-xaml: Setting tooltip using attached method syntax in resw no longer works in WinUI 3 Preview 3
Describe the bug Setting tooltip using attached method syntax in resw no longer works in WinUI 3 Preview 3
Steps to reproduce the bug
-
Start with WinUI 3 Desktop app template
-
Declare some UI element with Uid:
<Button x:Uid="button1" />
-
Create
Resources.reswunderStrings\en, and add a<PRIResource Include=Strings\**\*.reswto the project. -
Add tooltip in the resource file. According to UWP doc, the syntax for the key should be
button1.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip. -
Run the app. The app will fail with
XamlParseException.
Expected behavior The app should work with tooltip set from the localized resource. It worked in preview 2. This is a regression in preview 3.
Version Info
NuGet package version:
Microsoft.WinUI 3.0.0-preview3.201113.0
Windows app type:
| UWP | Win32 |
|---|---|
| Yes |
| Windows 10 version | Saw the problem? |
|---|---|
| 20H2(19042) | Yes |
| Device form factor | Saw the problem? |
|---|---|
| Desktop | Yes |
| Xbox | |
| Surface Hub | |
| IoT |
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
@JosHuybrighs Because
ToolTipService.ToolTipis an attached property, the correct syntax to use isMyButton.[using:Microsoft.UI.Xaml.Controls]ToolTipService.ToolTip(see this article for more details).@roxk I’ve also met the tooltip issue here
The current workaround is explicitly define a
ToolTipelement:and set
button1ToolTip.Contentin resources.