/// <inheritdoc/> protected override async ValueTask DisposeAsync(bool disposing) { if (disposing) { // remove button from parents ParentDropdown?.NotifyButtonRemoved(this); ParentAddons?.NotifyButtonRemoved(this); if (Rendered) { await JSModule.SafeDestroy(ElementRef, ElementId); } if (command != null) { command.CanExecuteChanged -= OnCanExecuteChanged; } if (Theme != null) { Theme.Changed -= OnThemeChanged; } } await base.DisposeAsync(disposing); }
/// <inheritdoc/> protected override async ValueTask DisposeAsync(bool disposing) { if (disposing) { // remove button from parents ParentDropdown?.NotifyButtonRemoved(this); ParentAddons?.NotifyButtonRemoved(this); if (Rendered) { var task = JSRunner.DestroyButton(ElementId); try { await task; } catch when(task.IsCanceled) { } } if (command != null) { command.CanExecuteChanged -= OnCanExecuteChanged; } if (Theme != null) { Theme.Changed -= OnThemeChanged; } } await base.DisposeAsync(disposing); }
/// <inheritdoc/> protected override void Dispose(bool disposing) { if (disposing) { // remove button from parents ParentDropdown?.NotifyButtonRemoved(this); ParentAddons?.UnRegister(this); if (Rendered) { 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) { }