public interface IContentState {
public EventCallback<IContentState> OnStateChanged { get; set; }
}
public class Parent : IContentState {
public EventCallback<IContentState> OnStateChanged { get; set; }
private async Task StateChangedInvoke() {
await OnStateChanged.InvokeAsync(this);
}
}
public class Child() {
public void RegisterContent(IContentState contentState) {
ContentState.OnStateChanged += OnContentStateChanged;
}
protected void OnContentStateChanged(IContentState contentState) {
// do
}
}
public event EventCallback<IContentState> StateChanged;