protected override void Dispose(bool disposing) { if (disposing) { // remove button from parents ParentDropdown?.UnRegister(this); ParentAddons?.UnRegister(this); JSRunner.DestroyButton(ElementId); } base.Dispose(disposing); }
/// <inheritdoc/> protected override async ValueTask DisposeAsync(bool disposing) { if (disposing) { // remove button from parents ParentDropdown?.NotifyButtonRemoved(this); ParentAddons?.UnRegister(this); if (Rendered) { var task = JSRunner.DestroyButton(ElementId); try { await task; } catch when(task.IsCanceled) { }