Infsoft.WPE.App.Modules.Base
0.1.1
Prefix Reserved
See the version list below for details.
dotnet add package Infsoft.WPE.App.Modules.Base --version 0.1.1
NuGet\Install-Package Infsoft.WPE.App.Modules.Base -Version 0.1.1
<PackageReference Include="Infsoft.WPE.App.Modules.Base" Version="0.1.1" />
paket add Infsoft.WPE.App.Modules.Base --version 0.1.1
#r "nuget: Infsoft.WPE.App.Modules.Base, 0.1.1"
// Install Infsoft.WPE.App.Modules.Base as a Cake Addin #addin nuget:?package=Infsoft.WPE.App.Modules.Base&version=0.1.1 // Install Infsoft.WPE.App.Modules.Base as a Cake Tool #tool nuget:?package=Infsoft.WPE.App.Modules.Base&version=0.1.1
Workplace Experience (WPE) Module Base Library
This library contains attributes and interfaces required to implement dynamic modules.
Attributes
The following attributes allow marking of Blazor components as specific components, which can be dynamically rendered in infsoft's Workplace Experience application.
- BannerExtension Content to be rendered in the main banner on the start page
- MapBoxLayer Not yet implemented, will follow
- POIButton Buttons to be rendered for a singular POI
- POIExtension Content to be rendered for a singular POI inside the main content
- POISection Content to be rendered for a singular POI below any other form of content
- ProfileExtension Selection to be rendered inside the profile overview
- Tile Content to be rendered as tiles
Interfaces
Some of the above mentioned attributes require the component to implement a specific interface. This is required to pass parameters to the component dynamically.
- POIComponent Any POI component receives the unique identifier of the POI it was opened for, as well as any properties the POI might specify
- TileComponent Any tile receives the display title to show
Dialog Manager
To allow any module to display dialogs in a consistent and uniform way the dialog manager can be used. It allows opening and closing a given dialog and displaying it as specified (e.g. as fullscreen or mobile dialog). The fragment provided is shown as dialog content, the rendering components (not part of this library) provide a uniform layout and closing functionality. Thus, your fragment does not need to close the dialog.
Dependency Injection
Services can be registered with the container for Dependency Injection. Simply follow the below guidelines.
Service registration
Every developed module might require the registration of services for dependency injection. To allow this, an extension point is provided by simply implementing the corresponding ModuleExtension interface. Every service, that is registered with the above mentioned method, will be registered in a custom scope unique to the module. This allows for quick dynamic assembly loading after startup.
Service injection
To inject your services, two possiblities exist:
- In normal
.cs
files, you can use normal constructor injection as you would anywhere else - In razor components, you have to inherit from the provided ComponentModule and use the provided method to set your service instances.
Services, that are provided by infsoft globally, e.g. login provider, can be injected with the
@inject
directive. Sample:@using Infsoft.WPE.App.Modules.Base @inherits ModuleComponent @inject IJSRuntime JSRuntime @code { private ISampleService SampleService; protected override void OnInitialized() { base.OnInitialized(); SampleService = GetService<ISampleService>(); } }
JavaScript Modules
One caveat of separating the assemblies in different contexts, is that you cannot directly inject IJSRuntime
into your code wrapper for the JavaScript code.
You can only use IJSRuntime
by injecting it in the razor classes and then passing it along to your module class as a method parameter.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Autofac (>= 8.0.0)
- Microsoft.AspNetCore.Components.Web (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.