Make GetUIPropertiesAsync method virtual
Allow derived classes to override the GetUIPropertiesAsync method by marking it as virtual. This change enhances flexibility and customization for implementations of DropDown and CheckList options providers.
This commit is contained in:
parent
4101794f95
commit
e6076d0c7d
|
|
@ -12,7 +12,7 @@ public abstract class CheckListOptionsProviderBase : IPropertyUIHandler
|
|||
protected virtual bool RefreshOnChange => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask<IDictionary<string, object>> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default)
|
||||
public virtual async ValueTask<IDictionary<string, object>> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var items = await GetItemsAsync(propertyInfo, context, cancellationToken);
|
||||
var props = new CheckListProps
|
||||
|
|
|
|||
|
|
@ -11,12 +11,12 @@ public abstract class DropDownOptionsProviderBase : IPropertyUIHandler
|
|||
protected virtual bool RefreshOnChange => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async ValueTask<IDictionary<string, object>> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default)
|
||||
public virtual async ValueTask<IDictionary<string, object>> GetUIPropertiesAsync(PropertyInfo propertyInfo, object? context, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var selectListItems = await GetItemsAsync(propertyInfo, context, cancellationToken);
|
||||
var props = new DropDownProps
|
||||
{
|
||||
SelectList = new SelectList(selectListItems)
|
||||
SelectList = new(selectListItems)
|
||||
};
|
||||
|
||||
var options = new Dictionary<string, object>
|
||||
|
|
|
|||
Loading…
Reference in a new issue