Skip to content

Commit

Permalink
feat(frameworktemplate): Improved the logging of `FrameworkTemplatePo…
Browse files Browse the repository at this point in the history
…ol` to show the actual factory lambda
  • Loading branch information
carldebilly committed Jan 13, 2022
1 parent b295720 commit d59c30f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Uno.UI/UI/Xaml/FrameworkTemplate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 1 addition & 3 deletions src/Uno.UI/UI/Xaml/FrameworkTemplatePool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<View>)template);

return $"{i}({func.Method.DeclaringType}.{func.Method.Name})";
}
}
Expand Down

0 comments on commit d59c30f

Please sign in to comment.