Application configuration
This page covers global application configuration: display name, environment, logos, button behavior, field reset, About page, default HTTP format, and global LgGridView options.
Application name
By default, the application name matches the Client project name without the .Client suffix. To customize it, set the App:Name key in the Server project's appsettings.json.
{
"App": {
"Name": "My Lagoon App"
}
}
Environment displayed in the header
The header's environment banner uses the App:EnvironmentName or App:EnvironmentDisplayName keys, and App:EnvironmentColor.
{
"App": {
"EnvironmentName": "RECETTE",
"EnvironmentDisplayName": "Recette",
"EnvironmentColor": "#195E75"
}
}
Application logo
The main logo is configured in the client project's styles with the SCSS variable $header-logo.
$header-logo: "~/images/header-logo.png";
The logo displayed on the right side of the header is configured with $toolbar-logo.
$toolbar-logo: "~/images/toolbar-logo.png";
Page display mode
Single-page mode replaces the active page on navigation. Tabbed mode is enabled with IsTabbed="true" on LgApp.
<LgApp DefaultLayout="typeof(PageLayout)" IsTabbed="true" ShowHeader="true">
<StartupTabs>
<LgStartupTab Link="Pages.Index.Link()" />
</StartupTabs>
<ChildContent>
<MenuConfiguration />
</ChildContent>
</LgApp>
Global behaviors in OnConfigureBehavior
Client-side configuration is done in Client/Main.cs by overriding OnConfigureBehavior(ApplicationBehavior app).
public class Main : LgCustomApplication
{
protected override void OnConfigureBehavior(ApplicationBehavior app)
{
// Sets the default size of buttons in application toolbars.
app.ToolbarButtonSize = ButtonSize.Medium;
app.FrameToolbarButtonSize = ButtonSize.Small;
app.ActionPanelToolbarButtonSize = ButtonSize.Large;
}
}
Reset button for inputs and selects
The global configuration of the field reset button is applied via app.ResetButton. Dropdown list configuration is done via app.Select and can reuse or specialize these values.
public class Main : LgCustomApplication
{
protected override void OnConfigureBehavior(ApplicationBehavior app)
{
// Hides the reset button on input fields.
app.ResetButton.HideAlwaysResetButton = true;
app.ResetButton.ResetText = "#reset";
app.ResetButton.ResetTextAriaLabel = "#resetAriaLabel";
// Specializes the reset text for LgSelect and LgSelectMultiple.
app.Select.ResetText = "#resetSelection";
}
}
About page
Additional information
Add additional information in the App:About:AdditionalInformation section.
{
"App": {
"About": {
"AdditionalInformation": [
{
"Label": "#aboutSupportLabel",
"Description": "support@example.com",
"Uri": "mailto:support@example.com"
}
]
}
}
}
AdditionalInformation is an array: you can add multiple entries.
Owner logo
OwnerLogoUri displays the owner's main logo on the About page.
public class Main : LgCustomApplication
{
protected override void OnConfigureBehavior(ApplicationBehavior app)
{
// Displays the customer's logo on the About page.
app.OwnerLogoUri = "_content/MyCompany/logo.png";
}
}
Developer logos
DevelopedByLogoUri displays the logos in the Developed by area.
public class Main : LgCustomApplication
{
protected override void OnConfigureBehavior(ApplicationBehavior app)
{
// Displays several contributor logos on the About page.
app.DevelopedByLogoUri = new List<string>
{
"_content/MyCompany/logo1.png",
"_content/MyCompany/logo2.png"
};
}
}
Default HTTP format
The Lagoon client can request MessagePack or JSON. The default behavior is driven by DefaultAcceptHeader.
public class Main : LgCustomApplication
{
protected override void OnConfigureBehavior(ApplicationBehavior app)
{
// Uses MessagePack for compatible HTTP exchanges.
app.DefaultAcceptHeader = DefaultAcceptHeader.MessagePack;
}
}
Global LgGridView options
Some LgGridView options can be changed globally in OnConfigureBehavior. They then apply to every grid displayed by the application, unless overridden locally.
public class Main : LgCustomApplication
{
protected override void OnConfigureBehavior(ApplicationBehavior app)
{
// Configures behaviors common to all grids.
app.GridView(options =>
{
options.ExportWithFilters = true;
options.ProfileStorageMode = GridViewProfileStorage.Remote;
options.SharedProfileAdministratorPolicy = "!*";
options.DisplayDefaultTooltipHeader = false;
options.ShowSummaryFilters = true;
});
}
}
List of reviewed options
| Option | Role |
|---|---|
AddItemOnTop | Displays the add row at the top. |
DefaultPageSize | Default number of rows per page. |
DisplayDefaultTooltipHeader | Forces the display of tooltips on headers. |
DisplayInputPageSelector | Displays the page selector as an input field. |
DisplaySuccessSaveMessage | Displays a success message after editing a cell. |
Exportable | Enables grid export. |
ExportDisplayedColumns | Exports only the displayed columns. |
ExportWithFilters | Exports with active filters by default. |
MaxSortedColumns | Maximum number of sorted columns at the same time (4 by default, 0: no limit; a negative value raises ArgumentOutOfRangeException). Overridden by the grid's MaxSortedColumns parameter. |
PagerOnTop | Displays the pager at the top of the grid. |
PaginationSizeSelector | Defines the available page sizes. |
ProfileStorageMode | Defines profile storage: Local or Remote. |
SharedProfileAdministratorPolicy | Policy allowing administration of shared profiles. |
ShowSummaryFilters | Displays the filter summary. |
TooltipPosition | Default position of tooltips. |
ProfileSaveMode | Defines the profile save mode. |
ProfileFeatures | Elements saved in profiles and reloaded from them (GridFeature: Filter, Sort, Move, Visibility, Freeze, Resize, Group, Paging; all by default, other flags are ignored; Move and Freeze go together). Overridden by the grid's ProfileFeatures parameter. |
ExportConfiguration | Groups export options. |
ResetInputConfiguration | Configures the grid filter reset button. |