Infsoft.WPE.App.Base 1.5.8

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Infsoft.WPE.App.Base --version 1.5.8
                    
NuGet\Install-Package Infsoft.WPE.App.Base -Version 1.5.8
                    
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.Base" Version="1.5.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Infsoft.WPE.App.Base" Version="1.5.8" />
                    
Directory.Packages.props
<PackageReference Include="Infsoft.WPE.App.Base" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Infsoft.WPE.App.Base --version 1.5.8
                    
#r "nuget: Infsoft.WPE.App.Base, 1.5.8"
                    
#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.
#:package Infsoft.WPE.App.Base@1.5.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Infsoft.WPE.App.Base&version=1.5.8
                    
Install as a Cake Addin
#tool nuget:?package=Infsoft.WPE.App.Base&version=1.5.8
                    
Install as a Cake Tool

Workplace Experience (WPE) App Base Library

This library contains attributes and interfaces required to implement dynamic apps.

SUMMARY:

Your app should implement IAppExtensions and annotate components with the below attributes, any annotated component must implement AppComponent or AppJsComponent and can use it's method to resolve services registered in the IAppExtensions.RegisterServices method.

If you define multiple subcomponents in your app, please use SubComponent and SubJsComponent respectively, allowing for much easier localization and service discovery.

Additionally you must define all used routes (that require authentication).

Attributes

The following attributes allow marking of Blazor components as specific components, which can be dynamically rendered in infsoft's Workplace Experience application.

  • App Fullscreen content of module (can hide navBar completely), allows arbitrary query (annotated by [SupplyFromQuery]) and static parameters (annotated with [Parameter])

  • Tile Content to be rendered as tile, allows arbitrary static parameters (annotated with [Parameter]), but no query parameters

  • NavEntry Entry to be rendered in the app's navbar, allows arbitrary static parameters (annotated with [Parameter]), but no query parameters

  • PoIButton Defines metadata for buttons to be rendered for a singular POI

    This component requires the base class PoIButtonBase to be implemented. Any PoI button is invoked to query if it should be rendered

  • PoIComponent Content to be rendered for a singular POI

    This component requires the interface IPoIParameters to be implemented. Any PoI component receives the unique identifier of the PoI it was opened for, as well as any properties the PoI might specify

  • Overlay Provides the possibility to render popups or other overlays ontop of the whole app

  • BackgroundLayer Provides the possibility to render stuff in the background, which should be hidden by default.

  • NavBar Allows to customize the navigation bar completely.

PoI Buttons

On any given PoI additional buttons can be displayed, if you wish to provide such an button implement the IPoIButton interface and annotate your class with the PoIButton attribute. Buttons are shown above any of the PoI components.

Defining Route mappings

This section is only relevant for the web application, native apps will ignore the mappings.

The application utilizes a Backend for Frontend (BFF) pattern, as such all requests that require authentication/authorization on the backend, must be proxied by the web backend. To achieve this dynamically, each app must define the mappings as assembly attributes by including the attribute in the project file (.csproj). Every request made by your app, will be filtered according to your mappings and whenever a request is made towards a defined baseUrl, it is replaced with the web app's base url and a dynamically generated hash. Then the request is made towards the web backend, which utilizes the application cookie to authorize the request and proxy it to your original URL and then returning the backend's response.

Sample:

<ItemGroup>
  <AssemblyAttribute Include = "Infsoft.WPE.App.Base.RouteMappingAttribute">
    <_Parameter1>https://postman-echo.com</_Parameter1>
  </AssemblyAttribute>
  <AssemblyAttribute Include = "Infsoft.WPE.App.Base.RouteMappingAttribute">
    <_Parameter1> https://localhost:5003</_Parameter1>
  </AssemblyAttribute>
</ItemGroup>

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 implementing the corresponding IAppExtensions interface. Every service, that is registered with the RegisterServices 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 constructor injection as you would anywhere else
  2. In razor components, you have to inherit from the provided AppComponent or AppJsComponent and use the provided method to set your service instances. Services, that are provided globally (by infsoft), e.g. the JavaScript runtime, can be injected with the @inject directive. Sample:
     @using Infsoft.WPE.App.Modules.Base
     @inherits AppComponent
     @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.

Therefore, if you do not have JS code shared between multiple razor classes, you can simply inherit from AppJsComponent. This class provides you with InvokeVoidAsync and InvokeAsync methods, which will automatically load your module scoped JavaScript.

Sub components

While inheriting from AppComponent and AppJsComponent works for direct entry points like tiles, PoI components and such, you might want to structure your code into more components.

Components referenced by your components (such a single tile) must not implement one of the above mentioned base classes, instead inherit from SubComponent or SubJsComponent. This is necessary to receive the correct localization definition required for all localization as a cascading value.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Infsoft.WPE.App.Base:

Package Downloads
Infsoft.WPE.App.Services

Library containing service definitions for infsoft's Workplace Experience application

Infsoft.WPE.App.Test

Base library for bunit tests, allowing to inject scoped autoFac services

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.12 55 7/14/2025
1.5.11 86 7/14/2025
1.5.10 48 7/14/2025
1.5.9 258 6/26/2025
1.5.8 168 6/26/2025
1.5.7 134 6/26/2025
1.5.6 138 6/25/2025
1.5.5 163 6/25/2025
1.5.4 138 6/25/2025
1.5.3 434 6/11/2025
1.5.2 285 6/11/2025
1.5.0 302 6/10/2025
1.4.2 366 5/19/2025
1.4.1 1,068 4/4/2025
1.4.0 857 3/26/2025
1.3.1 520 3/13/2025
1.3.0 355 3/13/2025
1.2.0 1,299 2/24/2025
1.1.10 1,350 12/18/2024
1.1.9 327 12/5/2024
1.1.8 383 12/3/2024
1.1.7 637 11/19/2024
1.1.6 1,163 11/7/2024
1.1.5 117 11/7/2024
1.1.4 115 11/7/2024
1.1.3 182 11/4/2024
1.1.2 149 11/4/2024
1.1.1 183 10/31/2024
1.1.0 737 10/18/2024
1.0.0 542 9/26/2024
1.0.0-next28 198 9/23/2024
1.0.0-next27 669 7/26/2024
1.0.0-next26 91 7/26/2024
1.0.0-next25 121 7/26/2024
1.0.0-next24 144 7/24/2024
1.0.0-next23 118 7/23/2024
1.0.0-next22 127 7/22/2024
1.0.0-next21 108 7/22/2024
1.0.0-next20 115 7/15/2024
1.0.0-next19 96 7/15/2024
1.0.0-next18 112 7/5/2024
1.0.0-next17 108 7/4/2024
1.0.0-next16 87 7/4/2024
1.0.0-next15 117 7/1/2024
1.0.0-next14 100 7/1/2024
1.0.0-next13 108 7/1/2024
1.0.0-next12 98 7/1/2024
1.0.0-next11 99 7/1/2024
1.0.0-next10 101 6/27/2024
1.0.0-next09 124 6/19/2024
1.0.0-next08 133 6/4/2024
1.0.0-next07 125 6/3/2024
1.0.0-next06 386 5/23/2024
1.0.0-next05 114 5/23/2024
1.0.0-next04 106 5/22/2024
1.0.0-next03 100 5/21/2024
1.0.0-next02 95 5/21/2024
1.0.0-next01 107 5/21/2024
1.0.0-next 98 5/21/2024