fix: 特定情况下崩溃:“ToolTip”不能有逻辑或视觉父级(Meloong-Git/PCL#8876,@lactobionicAcid)

This commit is contained in:
龙腾猫跃 committed 2026-07-03 14:05:42 +08:00
1 parent 1ee19b4023
commit c16ef849e6
1 file changed
+3 -1
+3 -1
View File
@@ -227,7 +227,9 @@ public static class ModernTooltipService {
private static bool TryGetToolTip(FrameworkElement owner, out object? content, out ToolTip? sourceToolTip) {
var raw = owner.ToolTip;
sourceToolTip = raw as ToolTip;
content = sourceToolTip?.Content ?? raw;
content = sourceToolTip is null
? raw
: sourceToolTip.Content ?? (ReferenceEquals(sourceToolTip, borrowedToolTip) ? borrowedContent : null);
return content is not null && (content is not string text || text.Length > 0);
}