refactor event to EventWrapper

This commit is contained in:
Matt Parker
2025-12-12 19:26:41 +10:00
parent b23febbcea
commit 253b3f0aac
4 changed files with 9 additions and 10 deletions

View File

@@ -17,7 +17,7 @@
protected override async Task OnInitializedAsync()
{
Project.ProjectStartedRunning += OnProjectStartedRunning;
Project.ProjectStartedRunning.Subscribe(OnProjectStartedRunning);
// This event may/will be raised before the component is initialized, so we call OnProjectStartedRunning directly, for the first render.
await OnProjectStartedRunning();
}
@@ -46,5 +46,5 @@
});
}
public void Dispose() => Project.ProjectStartedRunning -= OnProjectStartedRunning;
public void Dispose() => Project.ProjectStartedRunning.Unsubscribe(OnProjectStartedRunning);
}