Blazor IComponentTypeSwitchBroker
(Created page with "In Blazor one can inject unique components as described here EXT_ComponentsBlazor But you can also replace All or Some components based on a Switch-logic you define yourself public interface IComponentTypeSwitchBroker {    Type SwitchThis(IMDCompHolder compholder,Type theType); } The assembly and type that implements this interface is then given in the Documentation:SysMDrivenMiscSettingsSingleton property GlobalBlazorCl...")
 
No edit summary
Line 1: Line 1:
In Blazor one can inject unique components as described here [[Documentation:EXT ComponentsBlazor|EXT_ComponentsBlazor]]
In Blazor, one can inject unique components as described here [[Documentation:EXT ComponentsBlazor|EXT_ComponentsBlazor]]


But you can also replace All or Some components based on a Switch-logic you define yourself
But you can also replace '''all''' or '''some''' components based on a Switch-logic you define yourself:


  public interface IComponentTypeSwitchBroker
  public interface IComponentTypeSwitchBroker
Line 7: Line 7:
     Type SwitchThis(IMDCompHolder compholder,Type theType);
     Type SwitchThis(IMDCompHolder compholder,Type theType);
  }
  }
The assembly and type that implements this interface is then given in the [[Documentation:SysMDrivenMiscSettingsSingleton]] property GlobalBlazorClientComponentOverride, in the same format as you do for  [[Documentation:EXT ComponentsBlazor|EXT_ComponentsBlazor]] , namely :
The assembly and type that implements this interface is then given in the [[Documentation:SysMDrivenMiscSettingsSingleton|SysMDrivenMiscSettingsSingleton]] property GlobalBlazorClientComponentOverride, in the same format as you do for  [[Documentation:EXT ComponentsBlazor|EXT_ComponentsBlazor]] , namely:
  AssemblyNameWithoutExtension;AdditionalAssemblyIfNeededWithoutExtension;AsManyAssembliesAsNeededWithoutExtension;TheTypeImplementing_IComponentTypeSwitchBroker
  AssemblyNameWithoutExtension;AdditionalAssemblyIfNeededWithoutExtension;AsManyAssembliesAsNeededWithoutExtension;TheTypeImplementing_IComponentTypeSwitchBroker
[[Category:Blazor]]

Revision as of 05:15, 13 March 2025

This page was created by Hans.karlsen@mdriven.net on 2024-09-19. Last edited by Stephanie@mdriven.net on 2025-03-13.

In Blazor, one can inject unique components as described here EXT_ComponentsBlazor

But you can also replace all or some components based on a Switch-logic you define yourself:

public interface IComponentTypeSwitchBroker
{
   Type SwitchThis(IMDCompHolder compholder,Type theType);
}

The assembly and type that implements this interface is then given in the SysMDrivenMiscSettingsSingleton property GlobalBlazorClientComponentOverride, in the same format as you do for EXT_ComponentsBlazor , namely:

AssemblyNameWithoutExtension;AdditionalAssemblyIfNeededWithoutExtension;AsManyAssembliesAsNeededWithoutExtension;TheTypeImplementing_IComponentTypeSwitchBroker