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:
Sipke Schoorstra 2025-05-25 20:42:29 +02:00
parent 4101794f95
commit e6076d0c7d
No known key found for this signature in database
GPG key ID: 5C10502B28A4268F
2 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -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>