@message
@code { private RobotModel robotModel = new() { AxisSelection = Axis.Left }; private string? message; private void HandleValidSubmit() { Logger.LogInformation("HandleValidSubmit called"); var result = HandGesture.ThumbUp(robotModel.AxisSelection, Logger); message = $"ThumbUp returned {result} at {DateTime.Now}."; } public class RobotModel { public Axis AxisSelection { get; set; } } } ``` :::moniker-end :::moniker range="< aspnetcore-6.0" ```razor @page "/robot" @using Microsoft.AspNetCore.Components.Forms @using Microsoft.Extensions.Logging @inject ILogger@message
@code { private RobotModel robotModel = new RobotModel() { AxisSelection = Axis.Left }; private string message; private void HandleValidSubmit() { Logger.LogInformation("HandleValidSubmit called"); var result = HandGesture.ThumbUp(robotModel.AxisSelection, Logger); message = $"ThumbUp returned {result} at {DateTime.Now}."; } public class RobotModel { public Axis AxisSelection { get; set; } } } ``` :::moniker-end Create a Blazor WebAssembly app to demonstrate lazy loading of the RCL's assembly: 1. Create the Blazor WebAssembly app in Visual Studio, Visual Studio Code, or via a command prompt with the .NET CLI. Name the project `LazyLoadTest`. 1. Create a project reference for the `GrantImaharaRobotControls` RCL: * Visual Studio: Add the `GrantImaharaRobotControls` RCL project to the solution (**Add** > **Existing Project**). Select **Add** > **Project Reference** to add a project reference for the `GrantImaharaRobotControls` RCL. * Visual Studio Code/.NET CLI: Execute `dotnet add reference {PATH}` in a command shell from the project's folder. The `{PATH}` placeholder is the path to the RCL project. Build and run the app. For the default page that loads the `Index` component (`Pages/Index.razor`), the developer tool's Network tab indicates that the RCL's assembly `GrantImaharaRobotControls.dll` is loaded. The `Index` component makes no use of the assembly, so loading the assembly is inefficient. ![Index component loaded in the browser with developer tool's Network tab indicating that the GrantImaharaRobotControls.dll assembly is loaded.](~/blazor/webassembly-lazy-load-assemblies/_static/screenshot1.png) Configure the app to lazy load the `GrantImaharaRobotControls.dll` assembly: 1. Specify the RCL's assembly for lazy loading in the Blazor WebAssembly app's project file (`.csproj`): ```xmlLoading the requested page…
Sorry, there's nothing at this address.
Loading the requested page…
Sorry, there's nothing at this address.