mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-06 05:57:39 +08:00
cae7e144b3
* fix: selection
43 lines
1.0 KiB
C#
43 lines
1.0 KiB
C#
using System;
|
|
using System.Linq;
|
|
using System.Linq.Expressions;
|
|
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.AspNetCore.Components.Forms;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class Column<TData> : ColumnBase, IFieldColumn
|
|
{
|
|
[Parameter]
|
|
public EventCallback<TData> FieldChanged { get; set; }
|
|
|
|
[Parameter]
|
|
public Expression<Func<TData>> FieldExpression { get; set; }
|
|
|
|
[Parameter]
|
|
public bool Sort { get; set; }
|
|
|
|
[Parameter]
|
|
public RenderFragment<TData> CellRender { get; set; }
|
|
|
|
[Parameter]
|
|
public TData Field { get; set; }
|
|
|
|
private FieldIdentifier? _fieldIdentifier;
|
|
|
|
public string DisplayName => _fieldIdentifier?.GetDisplayName();
|
|
|
|
public string FieldName => _fieldIdentifier?.FieldName;
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
base.OnInitialized();
|
|
|
|
if (FieldExpression != null)
|
|
{
|
|
_fieldIdentifier = FieldIdentifier.Create(FieldExpression);
|
|
}
|
|
}
|
|
}
|
|
}
|