Ejemplo n.º 1
0
 internal async Task OnPointStateChanged(DemoChecklistPointContext selectedPoint)
 {
     if (Context is not null)
     {
         await JSInteropService.SetContextPointState(Context, selectedPoint);
     }
 }
Ejemplo n.º 2
0
        public async void OnPointSelected(DemoChecklistPointContext selectedPoint)
        {
            await PointDeSelected.InvokeAsync();

            await Task.Delay(200);

            await PointSelected.InvokeAsync(selectedPoint);
        }
        private static DemoChecklistPointContext UpdatePointStateFromLocalStore(
            IJSInteropService jSInteropService,
            IDictionary <string, bool> pointStates,
            DemoChecklistContext Context,
            DemoChecklistPointContext contextPoint)
        {
            string key = jSInteropService.GetContextPointKeyName(Context, contextPoint);

            if (pointStates.ContainsKey(key))
            {
                contextPoint.IsDone = pointStates[key];
            }

            return(contextPoint);
        }
Ejemplo n.º 4
0
 internal void OnPointSelected(DemoChecklistPointContext selectedContext) => InvokeAsync(() =>
 {
     pointContext = selectedContext;
     NavigationService.OpenSubSideNav(selectedContext.Order);
     StateHasChanged();
 });
Ejemplo n.º 5
0
 public string GetContextPointKeyName(DemoChecklistContext context, DemoChecklistPointContext contextPoint)
 => $"{context.Name}_{contextPoint.Name}";
Ejemplo n.º 6
0
 public async ValueTask SetContextPointState(DemoChecklistContext context, DemoChecklistPointContext contextPoint)
 => await jSRuntime.InvokeVoidAsync($"{jsNamespace}.setContextPointState", GetContextPointKeyName(context, contextPoint), contextPoint.IsDone);