Invoking state changes from anywhere
In this recipe, we’re exploring injecting state service globally in your Blazor application. State service can cover anything from a user’s app personalization to user session details or processing indicators. In our example, we’re implementing an overlay covering our interface during a long-running task. Overlay serves as a visual cue to users, signaling that their request is being executed and preventing any user interactions that could disrupt the ongoing process.
Getting ready
Before we explore the strategy to globally inject state service and trigger an overlay, do the following:
- Create a
Chapter05
/Recipe04
directory – this will be your working directory - Copy
Api
andEvent
files from theChapter05
/Data
directory in the GitHub repository - Copy the
Overlay.css
file from theChapter05
/Data
directory in the GitHub repository and rename itOverlay.razor.css
; after renaming, your IDE might display...