From fae1762366b10a1b80346df35863795b86efabc2 Mon Sep 17 00:00:00 2001 From: Twinki Date: Wed, 27 Dec 2023 20:45:47 -0500 Subject: [PATCH] Update readme.md --- readme.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 36d6489..3e5902a 100644 --- a/readme.md +++ b/readme.md @@ -20,9 +20,12 @@ An unofficial set of extensions for developing Nui interfaces with Blazor WASM i - For Nui Message handling, the [NuiMessageListener](src/CitizenFX.Extensions.Blazor.WebAssembly/NuiMessageListener.cs) must be injected as a root-component in index.html, and your component(s) must inherit [NuiComponent](src/CitizenFX.Extensions.Blazor.WebAssembly/NuiComponent.cs) - Add `` to your `index.html` in the `` - Add `builder.RootComponents.Add("#nui-message-listener");` in your `Program.cs` - - This adds some Javascript to your `` that directs any Nui Messages for the resource to `NuiMessageListener` + - This adds some Javascript to your `` that directs any Nui Messages for the resource to `NuiMessageListener` - Add `@inherits NuiComponent` in your component/razor page + - This is required for `NuiMessageListener` to `NuiMessageHandler`'s - Add `[NuiMessageHandler("")]` to any static or instanced method in your component + + - For triggering Nui Callbacks, [NuiCallbackService](src/CitizenFX.Extensions.Blazor.WebAssembly/Services/NuiCallbackService.cs) must be added to your service collection - Add `builder.Services.AddNuiServices();` in your `Program.cs` - Inject in your page with `@inject INuiCallbackService NuiCallbackService`