SeemGen/Components/Partials/EditorUIComponentBase.cs

29 lines
788 B
C#

using BLAIzor.Models;
using Microsoft.AspNetCore.Components;
namespace BLAIzor.Components.Partials
{
public class EditorUIComponentBase<T> : ComponentBase
{
[Parameter] public Func<T, Task> OnContentUpdated { get; set; }
[Parameter] public Func<T, Task> OnContentEditStarted { get; set; }
protected async Task NotifyContentUpdatedAsync(T updatedObject)
{
if (OnContentUpdated != null)
{
await OnContentUpdated.Invoke(updatedObject);
}
}
protected async Task NotifyContentEditStartedAsync(T updatedObject)
{
if (OnContentEditStarted != null)
{
await OnContentEditStarted.Invoke(updatedObject);
}
}
}
}