Skip to main content

BlazorConfig

Default conventions and behavior used by ServiceStack.Blazor Components

Assembly: ServiceStack.Blazor.dll
View Source
Declaration
public class BlazorConfig

Properties

Instance

View Source
Declaration
public static BlazorConfig Instance { get; }

Services

IOC used to resolve App dependencies (e.g. ILoggerFactory)

View Source
Declaration
public IServiceProvider? Services { get; set; }

Log

Custom ILogger for Blazor Components to use (default uses ILoggerFactory)

View Source
Declaration
public ILogger? Log { get; set; }

IsWasm

Flag App can use to detect if running in Blazor WASM or Blazor Server

View Source
Declaration
public bool IsWasm { get; set; }

DarkMode

Whether Components should be rendered in Dark Mode

View Source
Declaration
public bool DarkMode { get; }

EnableErrorLogging

Enable Error Logging (default true)

View Source
Declaration
public bool EnableErrorLogging { get; set; }

EnableVerboseLogging

Enable Verbose Logging (default false)

View Source
Declaration
public bool EnableVerboseLogging { get; set; }

EnableLogging

Enable Verbose Logging (default false)

View Source
Declaration
public bool EnableLogging { get; set; }

MaxFieldLength

Max Field Length in Format components (default 150)

View Source
Declaration
public int MaxFieldLength { get; set; }

MaxNestedFields

Max Number of Fields in Format components (default 2)

View Source
Declaration
public int MaxNestedFields { get; set; }

MaxNestedFieldLength

Max Field Length in Nested Types in Format components (default 30)

View Source
Declaration
public int MaxNestedFieldLength { get; set; }

RedirectSignIn

Sign In Page to redirect for Unauthorized access to protected compontents (default /signin)

View Source
Declaration
public string RedirectSignIn { get; set; }

UseLocalStorage

Whether to Register ILocalStorage with AddBlazorApiClient()

View Source
Declaration
public bool UseLocalStorage { get; set; }

DefaultProfileUrl

Image URI to use when No ProfileUrl exists

View Source
Declaration
public string DefaultProfileUrl { get; set; }

DefaultTableIcon

View Source
Declaration
public ImageInfo DefaultTableIcon { get; set; }

ApiBaseUrl

Capture the Server Api BaseUrl

View Source
Declaration
public string ApiBaseUrl { get; set; }

AssetsBasePath

Prefix added to relative Asset URLs

View Source
Declaration
public string AssetsBasePath { get; set; }

FallbackAssetsBasePath

Prefix used to add to fallback URLs when default Asset Path fails

View Source
Declaration
public string FallbackAssetsBasePath { get; set; }

AssetsPathResolver

Use custom strategy for resolving Asset Paths

View Source
Declaration
public Func<string, string> AssetsPathResolver { get; set; }

FallbackPathResolver

Use custom strategy for resolving Fallback Asset Paths

View Source
Declaration
public Func<string, string> FallbackPathResolver { get; set; }

UseInProcessClient

Whether ApiAsync BlazorComponentBase APIs should use IServiceGateway instead of JsonApiClient in Blazor Server by default

View Source
Declaration
public bool UseInProcessClient { get; set; }

AutoQueryGridDefaults

Change defaults for AutoQueryGrid Components

View Source
Declaration
public AutoQueryGridDefaults AutoQueryGridDefaults { get; set; }

JSParseObject

Function used to parse JS Object literals

View Source
Declaration
public Func<string, Dictionary<string, object>> JSParseObject { get; set; }

EvalExpression

Function used to evaluate script expressions in Inputs

View Source
Declaration
public Func<string, object> EvalExpression { get; set; }

FormatJsonOptions

View Source
Declaration
public JsonSerializerOptions FormatJsonOptions { get; set; }

DefaultFilters

Default Filter Conventions to use in DataGrid (for non AutoQuery APIs)

View Source
Declaration
public List<AutoQueryConvention> DefaultFilters { get; set; }

OnApiErrorAsync

View Source
Declaration
public Func<object, IHasErrorStatus, Task>? OnApiErrorAsync { get; set; }

Methods

Set(BlazorConfig)

View Source
Declaration
public static void Set(BlazorConfig config)
Parameters
TypeName
ServiceStack.Blazor.BlazorConfigconfig

GetLog()

View Source
Declaration
public ILogger? GetLog()
Returns

System.Nullable<ILogger>

DefaultAssetsPathResolver(String)

View Source
Declaration
public static string DefaultAssetsPathResolver(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

DefaultFallbackPathResolver(String)

View Source
Declaration
public static string DefaultFallbackPathResolver(string path)
Returns

System.String

Parameters
TypeName
System.Stringpath

DefaultJSObjectParser(String)

View Source
Declaration
public static Dictionary<string, object> DefaultJSObjectParser(string js)
Returns

Dictionary<System.String,System.Object>

Parameters
TypeName
System.Stringjs

ToggleDarkMode(Nullable<Boolean>)

View Source
Declaration
public bool ToggleDarkMode(bool? value = null)
Returns

System.Boolean

Parameters
TypeName
System.Nullable<System.Boolean>value