/// <inheritdoc/> protected override void OnInitialized() { // notify dropdown that the button is inside of it ParentDropdown?.NotifyButtonInitialized(this); // notify addons that the button is inside of it ParentAddons?.NotifyButtonInitialized(this); ExecuteAfterRender(async() => { await JSModule.Initialize(ElementRef, ElementId, new { PreventDefaultOnSubmit }); }); LoadingTemplate ??= ProvideDefaultLoadingTemplate(); if (Theme != null) { Theme.Changed += OnThemeChanged; } base.OnInitialized(); }
protected override void OnInit() { // notify dropdown that the button is inside of it ParentDropdown?.Register(this); base.OnInit(); }
/// <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 OnInitialized() { if (ParentDropdown is not null) { ParentDropdown.AddDropdownMenu(this); } base.OnInitialized(); }
/// <summary> /// Handles the item onclick event. /// </summary> /// <returns>A task that represents the asynchronous operation.</returns> protected Task ClickHandler() { if (!Disabled) { ParentDropdown?.Toggle(); } return(Clicked.InvokeAsync(null)); }
/// <summary> /// Handles the item onclick event. /// </summary> /// <returns>A task that represents the asynchronous operation.</returns> protected Task ClickHandler() { if (!Disabled) { ParentDropdown?.Toggle(); } return(Task.CompletedTask); }
/// <inheritdoc/> protected override void Dispose(bool disposing) { if (disposing) { if (ParentDropdown is not null) { ParentDropdown.RemoveDropdownMenu(this); } } base.Dispose(disposing); }
protected override void OnInitialized() { // notify dropdown that the button is inside of it ParentDropdown?.Register(this); ExecuteAfterRender(async() => { await JSRunner.InitializeButton(ElementId, ElementRef, PreventDefaultOnSubmit); }); base.OnInitialized(); }
protected override void Dispose(bool disposing) { if (disposing) { // remove button from parents ParentDropdown?.UnRegister(this); ParentAddons?.UnRegister(this); JSRunner.DestroyButton(ElementId); } base.Dispose(disposing); }
/// <summary> /// Handles the onclick event, if not disabled. /// </summary> /// <returns></returns> protected async Task ClickHandler() { if (!Disabled) { if (ParentDropdown is not null) { if (!ParentDropdown.WasJustToggled) { await ParentDropdown.Hide(true); } } await Clicked.InvokeAsync(Value); } }
/// <inheritdoc/> protected override void OnInitialized() { if (ParentDropdown is not null) { ParentDropdown.NotifyDropdownToggleInitialized(this); } if (Theme != null) { Theme.Changed += OnThemeChanged; } base.OnInitialized(); }
/// <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) { }
/// <inheritdoc/> protected override void OnInitialized() { // notify dropdown that the button is inside of it ParentDropdown?.NotifyButtonInitialized(this); // notify addons that the button is inside of it ParentAddons?.Register(this); ExecuteAfterRender(async() => { await JSRunner.InitializeButton(ElementRef, ElementId, PreventDefaultOnSubmit); }); if (LoadingTemplate == null) { LoadingTemplate = ProvideDefaultLoadingTemplate(); } base.OnInitialized(); }
public Task Close(CloseReason closeReason) { ParentDropdown?.Hide(); return(Task.CompletedTask); }
protected Task ClickHandler() { ParentDropdown?.Toggle(); return(Task.CompletedTask); }
protected void ClickHandler() { ParentDropdown?.Toggle(); }