diff --git a/src/Uno.UI/UI/Xaml/FrameworkTemplate.cs b/src/Uno.UI/UI/Xaml/FrameworkTemplate.cs index fbf61d1687dc..a302c3705339 100644 --- a/src/Uno.UI/UI/Xaml/FrameworkTemplate.cs +++ b/src/Uno.UI/UI/Xaml/FrameworkTemplate.cs @@ -27,7 +27,7 @@ namespace Windows.UI.Xaml public partial class FrameworkTemplate : DependencyObject { - private readonly FrameworkTemplateBuilder? _viewFactory; + internal readonly FrameworkTemplateBuilder? _viewFactory; private readonly int _hashCode; private readonly ManagedWeakReference? _ownerRef; diff --git a/src/Uno.UI/UI/Xaml/FrameworkTemplatePool.cs b/src/Uno.UI/UI/Xaml/FrameworkTemplatePool.cs index 4fe778e33c08..06fe68a1c699 100644 --- a/src/Uno.UI/UI/Xaml/FrameworkTemplatePool.cs +++ b/src/Uno.UI/UI/Xaml/FrameworkTemplatePool.cs @@ -320,10 +320,8 @@ private string GetTemplateDebugId(FrameworkTemplate? template) { i++; var pooledTemplate = kvp.Key; - if (template?.Equals(pooledTemplate) ?? false) + if ((template?.Equals(pooledTemplate) ?? false) && template._viewFactory is { } func) { - var func = ((Func)template); - return $"{i}({func.Method.DeclaringType}.{func.Method.Name})"; } }