### Install Babylon.Blazor via .NET CLI
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Installs the Babylon.Blazor NuGet package using the .NET Command Line Interface. This command adds the library to your Blazor project's dependencies.
```bash
dotnet add package Babylon.Blazor
```
--------------------------------
### Install Babylon.Blazor via Package Manager
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Installs the Babylon.Blazor NuGet package using the Package Manager Console in Visual Studio. This command adds the library to your Blazor project's dependencies.
```powershell
Install-Package Babylon.Blazor
```
--------------------------------
### Custom Scene Creator in C#
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Provides an example of creating a custom scene creator class in C# by inheriting from `SceneCreator`. This class is responsible for defining and initializing the 3D scene.
```C#
public class MySceneCreator : SceneCreator
{
public override async Task CreateAsync(BabylonCanvasBase canvas)
{
...
}
}
```
--------------------------------
### Custom Razor Component for Canvas
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
An example of a Razor component that inherits from a custom `BabylonCanvasBase` class. It renders a canvas element, enabling the display of custom 3D scenes within a Blazor application.
```HTML
@inherits MyCustomCanvas
```
--------------------------------
### Callback Function Sample JS to .NET
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Illustrates setting up a callback function from JavaScript to .NET. This enables asynchronous communication where JavaScript can trigger C# methods, often used for event handling or data updates.
```C#
// Example C# setup for JS callback (details not provided in source text)
// await _jSInstance.InvokeAsync("registerCallback", DotNetObjectReference.Create(this));
```
--------------------------------
### Configure Dependency Injection for InstanceCreator (Server)
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Configures the `InstanceCreator` service for server-side rendering in Blazor. It registers `InstanceCreatorAsyncMode` which requires an `IJSRuntime` dependency.
```csharp
public class Program
{
public static async Task Main(string[] args)
{
...
builder.Services.AddTransient(sp => new InstanceCreatorAsyncMode(sp.GetService()));
var app = builder.Build();
}
}
```
--------------------------------
### Configure Dependency Injection for InstanceCreator (Client)
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Configures the `InstanceCreator` service for client-side rendering in Blazor. It registers the client-side `InstanceCreator` which also requires an `IJSRuntime` dependency.
```csharp
builder.Services.AddTransient(sp => new InstanceCreator(sp.GetService()));
await builder.Build().RunAsync();
```
--------------------------------
### Custom Loading Template in Blazor Canvas
Source: https://github.com/alexnek/babylonblazor/blob/master/readme.md
Demonstrates how to provide a custom loading template for the `BabylonCanvas` component. This allows displaying custom content while the Babylon engine initializes and renders the scene.
```HTML
Loading Custom Demo...
```
--------------------------------
### Use SVG Sprite for Open Iconic Icons
Source: https://github.com/alexnek/babylonblazor/blob/master/Babylon.Blazor.App/Babylon.Blazor.App/wwwroot/css/open-iconic/README.md
Demonstrates embedding icons from an SVG sprite using the `