Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Columns/TableViewTemplateColumn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ public TableViewTemplateColumn()
/// <returns>A ContentControl element.</returns>
public override FrameworkElement GenerateElement(TableViewCell cell, object? dataItem)
{
var template = CellTemplateSelector?.SelectTemplate(dataItem) ?? CellTemplate;
return (template?.LoadContent() as FrameworkElement)!;
return new ContentControl
{
ContentTemplate = CellTemplateSelector?.SelectTemplate(dataItem) ?? CellTemplate
};
Comment thread
w-ahmad marked this conversation as resolved.
}

/// <summary>
Expand All @@ -40,8 +42,10 @@ public override FrameworkElement GenerateEditingElement(TableViewCell cell, obje
{
if (EditingTemplate is not null || EditingTemplateSelector is not null)
{
var template = EditingTemplateSelector?.SelectTemplate(dataItem) ?? EditingTemplate;
return (template?.LoadContent() as FrameworkElement)!;
return new ContentControl
{
Comment thread
w-ahmad marked this conversation as resolved.
ContentTemplate = EditingTemplateSelector?.SelectTemplate(dataItem) ?? EditingTemplate
};
}

return GenerateElement(cell, dataItem);
Expand Down