internal Task CloseAsync(IDrawerRef drawerRef) { if (OnCloseEvent != null) { return(OnCloseEvent.Invoke(drawerRef)); } return(Task.CompletedTask); }
/// <summary> /// Create and Open a drawer /// </summary> private async Task DrawerService_OnCreate(IDrawerRef drawerRef) { drawerRef.Options.Visible = true; if (!_drawerRefs.Contains(drawerRef)) { _drawerRefs.Add(drawerRef); } await InvokeAsync(StateHasChanged); }
/// <summary> /// Close the drawer /// </summary> private async Task DrawerService_OnClose(IDrawerRef drawerRef) { drawerRef.Options.Visible = false; await InvokeAsync(StateHasChanged); await Task.Delay(300); if (_drawerRefs.Contains(drawerRef)) { _drawerRefs.Remove(drawerRef); } }