fix: 特定情况下崩溃:“ToolTip”不能有逻辑或视觉父级(Meloong-Git/PCL#8876,@lactobionicAcid)
This commit is contained in:
1 parent
1ee19b4023
commit
c16ef849e6
1 file changed
+3
-1
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user