protected override async Task OnAfterRenderAsync(bool firstRender) { baseModule = await JSRuntime !.InvokeAsync <IJSObjectReference>("import", BasePath); if (firstRender) { isFirstRendered = true; if (!addedToHost) { if (HostId == null) { LayerHost = LayerHostService.GetDefaultHost(); } else { LayerHost = LayerHostService.GetHost(HostId); } if (LayerHost != null) { LayerHost.AddOrUpdateHostedContentAsync(id, ChildContent); addedToHost = true; StateHasChanged(); } } await baseModule !.InvokeVoidAsync("addOrUpdateVirtualParent", _element); } await base.OnAfterRenderAsync(firstRender); }
protected override async Task OnAfterRenderAsync(bool firstRender) { if (firstRender) { isFirstRendered = true; if (!addedToHost) { if (HostId == null) { LayerHost = LayerHostService.GetDefaultHost(); } else { LayerHost = LayerHostService.GetHost(HostId); } if (LayerHost != null) { LayerHost.AddOrUpdateHostedContentAsync(id, ChildContent); addedToHost = true; StateHasChanged(); } } await JSRuntime.InvokeVoidAsync("BlazorFluentUiBaseComponent.addOrUpdateVirtualParent", _element); } await base.OnAfterRenderAsync(firstRender); }
protected override async Task OnParametersSetAsync() { if (!addedToHost) { if (HostId == null) { LayerHost = LayerHostService.GetDefaultHost(); } else { LayerHost = LayerHostService.GetHost(HostId); } if (LayerHost != null) { LayerHost.AddOrUpdateHostedContentAsync(id, ChildContent); addedToHost = true; } } await base.OnParametersSetAsync(); }