void childControl_VisibilityChanged(object sender, HiddenEvent e) { if (e.isHidden) { //close control here } }
void Hide() { LeanTween.scale(gameObject, Vector3.zero, animationDuration).setEase(animationEase).setOnComplete(() => { shown = false; HiddenEvent?.Invoke(this); // gameObject.SetActive(false); }); }
private async Task OnAnimationEnd(string id) { BSModalEvent = new BSModalEvent() { Target = this }; if (id != MyRef.Id) { await new BlazorStrapInterop(JSRuntime).RemoveEventAnimationEnd(MyRef); if (IsOpen ?? false) { await ShownEvent.InvokeAsync(BSModalEvent).ConfigureAwait(false); } else { await HiddenEvent.InvokeAsync(BSModalEvent).ConfigureAwait(false); } _canShow = IsOpen ?? false; _drawing = false; await InvokeAsync(StateHasChanged).ConfigureAwait(false); } }
void yourControl_VisibilityChanged(object sender, HiddenEvent e) { //This is your main form //dispose control here }
public virtual void Hide() { gameObject.SetActive(false); HiddenEvent?.Invoke(this); }