Infsoft.WPE.App.Modules.Base 0.1.1

Prefix Reserved
There is a newer version of this package available.
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                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Infsoft.WPE.App.Modules.Base" Version="0.1.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Infsoft.WPE.App.Modules.Base --version 0.1.1                
#r "nuget: Infsoft.WPE.App.Modules.Base, 0.1.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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:

  1. In normal .cs files, you can use normal constructor injection as you would anywhere else
  2. 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.4 1,685 6/4/2024
0.1.3 2,262 4/8/2024
0.1.2 2,534 3/1/2024
0.1.1 2,614 2/6/2024
0.1.0 129 2/6/2024
0.0.3 192 10/11/2023
0.0.2 147 10/9/2023
0.0.1 154 10/9/2023