DwsDialog
A dialog is either a component opened through IDwsDialogService.Show<T>() - it closes with a result the caller awaits - or a DwsDialog declared inline and shown through IsVisible. The first four sections are complete scenarios; the sections after them show one group of options each.
API ReferenceEdit profile: a form that returns its data
DialogService.Show<T>() opens a component as a dialog, hands it the current profile through DwsDialogParameters and awaits DwsDialogResult. The dialog closes with Close(DwsDialogResult.Ok(profile)), so the page receives the edited copy in result.Data; Cancel, Escape and the close button leave the page's profile untouched. InitialFocus = FirstControl puts the cursor into the first field.
Nothing edited yet.
Show Code
DialogCustom.razor
@inject IDwsDialogService DialogService
<div class="d-flex flex-wrap align-items-center gap-3">
<DwsAvatar Name="CustomDialogDemo_ProfileAvatar" FullName="@_profile.DisplayName" Color="DwsColor.Primary" />
<div class="d-flex flex-column">
<DwsTypography Name="CustomDialogDemo_ProfileName" Typography="DwsTypographyType.Subtitle" Class="mb-0">@_profile.DisplayName</DwsTypography>
<DwsTypography Name="CustomDialogDemo_ProfileDetails" Typography="DwsTypographyType.Caption">@ProfileDetails</DwsTypography>
</div>
<DwsButton Name="CustomDialogDemo_ProfileEdit" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.PersonGear" OnClick="OnEditProfileAsync">Edit profile</DwsButton>
</div>
<p class="mt-3 mb-0" aria-live="polite">@ProfileResult</p>DialogCustom.razor.cs
private DemoDialogProfile _profile = new("Anna Schmidt", "anna.schmidt@example.com", "Product designer", false);
private bool? _profileSaved;
private string ProfileDetails => string.Join(" · ",
new[] { _profile.JobTitle, _profile.ShowEmail ? _profile.Email : string.Empty }.Where(part => !string.IsNullOrWhiteSpace(part)));
private string ProfileResult => _profileSaved switch
{
null => "Nothing edited yet.",
true => "Profile saved: the page shows what the dialog returned.",
false => "Editing cancelled - the profile is unchanged.",
};
private async Task OnEditProfileAsync()
{
DwsDialogParameters parameters = new()
{
{ "Name", "CustomDialogDemo_ProfileDialog" },
{ "Profile", _profile },
};
DwsDialogOptions options = new()
{
MaxWidth = MaxWidth.Small,
FullWidth = true,
CloseButton = true,
CloseOnEscapeKey = true,
InitialFocus = DwsDialogInitialFocus.FirstControl,
};
IDwsDialogReference dialog = DialogService.Show<DemoDialogEditProfile>("Edit profile", parameters, options);
DwsDialogResult result = await dialog.Result;
if (!result.Cancelled && result.Data is DemoDialogProfile updated)
{
_profile = updated;
_profileSaved = true;
}
else
{
_profileSaved = false;
}
}
// DemoDialogProfile.cs
public sealed record DemoDialogProfile(string DisplayName, string Email, string JobTitle, bool ShowEmail);DemoDialogEditProfile.razor
@* DemoDialogContentBase = DwsBaseBlazorComponent + [CascadingParameter] DwsDialogInstance? InstanceDialog
(the hosting dialog: Close(result) / Cancel()) + T(key, fallback) for the demo texts. *@
@inherits DemoDialogContentBase
<DwsDialog Name="@($"{Name}_Dialog")">
<DialogContent>
<div class="d-flex flex-column gap-3">
<DwsInput Name="@($"{Name}_DisplayName")" T="string" Label="Display name" @bind-Value="_displayName" Validate="ValidateDisplayName" />
<DwsInput Name="@($"{Name}_Email")" T="string" Label="Email" @bind-Value="_email" Validate="ValidateEmail" />
<DwsInput Name="@($"{Name}_JobTitle")" T="string" Label="Job title" @bind-Value="_jobTitle" />
<DwsSwitch Name="@($"{Name}_ShowEmail")" Label="Show my email address to colleagues" @bind-Value="_showEmail" />
</div>
</DialogContent>
<DialogActions>
<DwsButton Name="@($"{Name}_Cancel")" Appearance="DwsAppearance.Text" OnClick="OnCancel">Cancel</DwsButton>
<DwsButton Name="@($"{Name}_Save")" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" Disabled="@(!IsValid)" OnClick="OnSave">Save profile</DwsButton>
</DialogActions>
</DwsDialog>DemoDialogEditProfile.razor.cs
public partial class DemoDialogEditProfile : DemoDialogContentBase
{
// The profile to edit. The dialog never changes it: it returns a new one.
[Parameter]
public DemoDialogProfile Profile { get; set; } = new(string.Empty, string.Empty, string.Empty, false);
private string _displayName = string.Empty;
private string _email = string.Empty;
private string _jobTitle = string.Empty;
private bool _showEmail;
private bool _copied;
private bool IsValid => ValidateDisplayName(_displayName) is null && ValidateEmail(_email) is null;
protected override void ParameterSetCallback()
{
// Copy once: the dialog edits its own fields, a later parameter set must not reset what was typed.
if (!_copied)
{
_copied = true;
_displayName = Profile.DisplayName;
_email = Profile.Email;
_jobTitle = Profile.JobTitle;
_showEmail = Profile.ShowEmail;
}
base.ParameterSetCallback();
}
private string? ValidateDisplayName(string? value) =>
string.IsNullOrWhiteSpace(value) ? "Enter the name your colleagues see." : null;
private string? ValidateEmail(string? value) =>
string.IsNullOrWhiteSpace(value) || !value.Contains('@') || value.Trim().EndsWith('@')
? "Enter an email address such as name@example.com."
: null;
private void OnSave()
{
if (!IsValid)
{
return;
}
InstanceDialog?.Close(DwsDialogResult.Ok(new DemoDialogProfile(_displayName.Trim(), _email.Trim(), _jobTitle.Trim(), _showEmail)));
}
private void OnCancel() => InstanceDialog?.Cancel();
}Create project: validation and an unsaved-input guard
Create stays disabled while the name is invalid. The dialog has no close button and CloseOnEscapeKey is off: Cancel, Escape (OnKeyDown) and a click on the backdrop (OnBackdropClick replaces the default cancel) all go through one method, which closes at once when nothing was typed and otherwise asks in a message box stacked above the dialog.
No project created yet.
Show Code
DialogCustom.razor
@inject IDwsDialogService DialogService
<DwsButton Name="CustomDialogDemo_ProjectCreate" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.FolderPlus" OnClick="OnCreateProjectAsync">New project</DwsButton>
<p class="mt-3 mb-2" aria-live="polite">@ProjectResult</p>
@if (_projects.Count > 0)
{
<div class="d-flex flex-wrap gap-2">
@foreach ((DemoDialogProject project, int index) in _projects.Select((project, index) => (project, index)))
{
<DwsChip @key="index" Name="@($"CustomDialogDemo_Project_{index}")" Text="@project.Name" Icon="@(project.IsPrivate ? Icons.BS.Lock : Icons.BS.Folder)" Appearance="DwsAppearance.Outline" />
}
</div>
}DialogCustom.razor.cs
private readonly List<DemoDialogProject> _projects = [];
private bool? _projectCreated;
private string ProjectResult => _projectCreated switch
{
null => "No project created yet.",
true => $"Created “{_projects[^1].Name}” ({(_projects[^1].IsPrivate ? "private" : "visible to the team")}).",
false => "Nothing was created.",
};
private async Task OnCreateProjectAsync()
{
DwsDialogParameters parameters = new() { { "Name", "CustomDialogDemo_ProjectDialog" } };
// CloseButton and CloseOnEscapeKey off (set explicitly: null takes the app-wide default, which is on): both would cancel without asking. The dialog handles Escape itself.
DwsDialogOptions options = new()
{
MaxWidth = MaxWidth.Small,
FullWidth = true,
InitialFocus = DwsDialogInitialFocus.FirstControl,
CloseButton = false,
CloseOnEscapeKey = false,
};
IDwsDialogReference dialog = DialogService.Show<DemoDialogCreateProject>("New project", parameters, options);
DwsDialogResult result = await dialog.Result;
if (!result.Cancelled && result.Data is DemoDialogProject project)
{
_projects.Add(project);
_projectCreated = true;
}
else
{
_projectCreated = false;
}
}
// DemoDialogProject.cs
public sealed record DemoDialogProject(string Name, string Description, bool IsPrivate);DemoDialogCreateProject.razor
@* DemoDialogContentBase = DwsBaseBlazorComponent + [CascadingParameter] DwsDialogInstance? InstanceDialog
(the hosting dialog: Close(result) / Cancel()) + T(key, fallback) for the demo texts. *@
@inherits DemoDialogContentBase
<DwsDialog Name="@($"{Name}_Dialog")" OnBackdropClick="OnBackdropClickAsync" OnKeyDown="OnKeyDownAsync">
<DialogContent>
<div class="d-flex flex-column gap-3">
<DwsInput Name="@($"{Name}_ProjectName")" T="string" Label="Project name" Placeholder="e.g. Website relaunch" MaxLength="40" @bind-Value="_projectName" Validate="ValidateProjectName" />
<DwsInput Name="@($"{Name}_Description")" T="string" Label="Description (optional)" Lines="3" @bind-Value="_description" />
<DwsSwitch Name="@($"{Name}_Private")" Label="Private: only invited members see it" @bind-Value="_isPrivate" />
<DwsTypography Name="@($"{Name}_Hint")" Typography="DwsTypographyType.Caption">Ctrl + Enter creates the project, Escape asks before it throws your input away.</DwsTypography>
</div>
</DialogContent>
<DialogActions>
<DwsButton Name="@($"{Name}_Cancel")" Appearance="DwsAppearance.Text" OnClick="RequestCloseAsync">Cancel</DwsButton>
<DwsButton Name="@($"{Name}_Create")" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" StartIcon="@Icons.BS.FolderPlus" Disabled="@(!IsValid)" OnClick="OnCreate">Create project</DwsButton>
</DialogActions>
</DwsDialog>DemoDialogCreateProject.razor.cs
public partial class DemoDialogCreateProject : DemoDialogContentBase
{
[Inject]
private IDwsDialogService DialogService { get; set; } = default!;
private string _projectName = string.Empty;
private string _description = string.Empty;
private bool _isPrivate;
// The discard question is open: a second Escape or backdrop click must not stack another one.
private bool _asking;
private bool IsValid => ValidateProjectName(_projectName) is null;
private bool HasInput => !string.IsNullOrWhiteSpace(_projectName) || !string.IsNullOrWhiteSpace(_description) || _isPrivate;
private string? ValidateProjectName(string? value)
{
string name = value?.Trim() ?? string.Empty;
if (name.Length == 0)
{
return "Enter a project name.";
}
return name.Length < 3 ? "Use at least 3 characters." : null;
}
private void OnCreate()
{
if (!IsValid)
{
return;
}
InstanceDialog?.Close(DwsDialogResult.Ok(new DemoDialogProject(_projectName.Trim(), _description.Trim(), _isPrivate)));
}
// Bound as OnBackdropClick: the dialog no longer cancels itself on a backdrop click, this handler decides.
private Task OnBackdropClickAsync(MouseEventArgs args) => RequestCloseAsync();
// Keys pressed inside the dialog body (CloseOnEscapeKey is off, so Escape arrives here as well).
private async Task OnKeyDownAsync(KeyboardEventArgs args)
{
if (args.Key == "Escape")
{
await RequestCloseAsync();
}
else if (args.Key == "Enter" && args.CtrlKey)
{
OnCreate();
}
}
private async Task RequestCloseAsync()
{
if (!HasInput)
{
InstanceDialog?.Cancel();
return;
}
if (_asking)
{
return;
}
_asking = true;
try
{
// A message box stacked above this dialog; Escape there means "Keep editing".
DwsMessageBoxResult answer = await DialogService.ShowMessageBox(new DwsMessageBoxOptions
{
Title = "Discard the new project?",
Content = "The name and description you entered will be lost.",
OkText = "Discard",
CancelText = "Keep editing",
OkColor = DwsColor.Error,
Severity = DwsMessageBoxSeverity.Warning,
DialogOptions = new DwsDialogOptions { MaxWidth = MaxWidth.ExtraSmall, CloseOnEscapeKey = true },
});
if (answer.Confirmed)
{
InstanceDialog?.Cancel();
}
}
finally
{
_asking = false;
}
}
}Share a document: pickers inside a dialog
An inline DwsDialog, opened and closed through its two-way bound IsVisible. The select, the date and time pickers and the popover open above the dialog and stay on screen, Escape closes only the innermost popup, and Stop sharing asks in a stacked message box - closing it gives the focus back to the button in the dialog.
Not shared yet.
Show Code
DialogCustom.razor
@inject IDwsDialogService DialogService
<DwsButton Name="CustomDialogDemo_ShareOpen" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.Share" OnClick="OnOpenShare">Share “Q4 budget.xlsx”</DwsButton>
<p class="mt-3 mb-0" aria-live="polite">@ShareResult</p>
<DwsDialog Name="CustomDialogDemo_ShareDialog" @bind-IsVisible="_shareVisible" Title="Share “Q4 budget.xlsx”" Options="@_shareOptions">
<DialogContent>
<div class="d-flex flex-column gap-3">
<DwsSelect Name="CustomDialogDemo_SharePeople" T="string" Label="People" EnableSearch="true" IsMultiple="true" Options="@SharePeople" @bind-Values="_shareRecipients" />
<div class="d-flex flex-wrap align-items-end gap-2">
<DwsSelect Name="CustomDialogDemo_ShareAccess" T="string" Label="Access" Options="@ShareAccessLevels" @bind-Value="_shareAccess" />
<DwsPopover Name="CustomDialogDemo_ShareAccessHelp" Title="Access levels" Content="Viewers can open the file. Commenters can also comment. Editors can change it and share it with others.">
<DwsButton Name="CustomDialogDemo_ShareAccessHelpButton" Appearance="DwsAppearance.Outline">Who can do what?</DwsButton>
</DwsPopover>
</div>
<DwsDateTimePicker Name="CustomDialogDemo_ShareExpires" Label="Access expires" @bind-Value="@_shareExpires" />
<DwsTimePicker Name="CustomDialogDemo_ShareSendAt" Label="Send the invitation at" @bind-Value="@_shareSendAt" />
</div>
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_ShareStop" Appearance="DwsAppearance.Outline" Color="DwsColor.Error" OnClick="OnStopSharingAsync">Stop sharing</DwsButton>
<DwsButton Name="CustomDialogDemo_ShareCancel" Appearance="DwsAppearance.Text" OnClick="OnCloseShare">Cancel</DwsButton>
<DwsButton Name="CustomDialogDemo_ShareSend" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" Disabled="@(ShareRecipientCount == 0)" OnClick="OnShare">Share</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _shareVisible;
private readonly DwsDialogOptions _shareOptions = new() { MaxWidth = MaxWidth.Small, FullWidth = true, CloseButton = true, CloseOnEscapeKey = true };
private List<string>? _shareRecipients = ["Ben Okafor"];
private string? _shareAccess = "editor";
private DateTime? _shareExpires = DateTime.Today.AddDays(30).AddHours(18);
private TimeOnly? _shareSendAt = new(9, 0);
private string? _sharedWith;
private string? _sharedAccess;
private DateTime? _sharedUntil;
private bool _sharingStopped;
private int ShareRecipientCount => _shareRecipients?.Count ?? 0;
// Built once: a new list on every render would re-render the select each time.
private readonly List<DwsSelectOptionData<string>> SharePeople =
[.. new[] { "Anna Schmidt", "Ben Okafor", "Chiara Rossi", "David Kim", "Emma Larsen", "Felix Wagner", "Hana Sato", "Jonas Becker" }
.Select(person => new DwsSelectOptionData<string> { Value = person, Text = person })];
// (The demo builds this list from its translations, once per language.)
private readonly List<DwsSelectOptionData<string>> ShareAccessLevels =
[
new() { Value = "viewer", Text = "Viewer" },
new() { Value = "commenter", Text = "Commenter" },
new() { Value = "editor", Text = "Editor" },
];
private string ShareResult => _sharingStopped
? "Sharing stopped - only you can open the file now."
: _sharedWith is null
? "Not shared yet."
: _sharedUntil is null
? $"Shared with {_sharedWith} as {_sharedAccess}, with no end date."
: $"Shared with {_sharedWith} as {_sharedAccess}, access until {_sharedUntil:g}.";
private void OnOpenShare() => _shareVisible = true;
private void OnCloseShare() => _shareVisible = false;
private void OnShare()
{
_sharedWith = string.Join(", ", _shareRecipients ?? []);
_sharedAccess = _shareAccess;
_sharedUntil = _shareExpires;
_sharingStopped = false;
_shareVisible = false;
}
// A message box stacked above the inline dialog; closing it gives the focus back to the Stop sharing button.
private async Task OnStopSharingAsync()
{
bool confirmed = await DialogService.ShowMessageBox(
"Stop sharing “Q4 budget.xlsx”?",
"Everyone you shared the file with loses access at once, and the link stops working.",
DwsColor.Error,
"Stop sharing",
"Cancel");
if (!confirmed)
{
return;
}
_shareRecipients = [];
_sharedWith = null;
_sharingStopped = true;
_shareVisible = false;
}Terms of use: long content and a required answer
MaxContentHeight caps the body: longer content scrolls inside it while the title and the actions stay in view. DisableBackdropClick and no close button make Accept or Decline the only way out. The second button opens the same dialog with FullScreen, on every screen size.
Not answered yet.
Show Code
DialogCustom.razor
<div class="d-flex flex-wrap gap-2">
<DwsButton Name="CustomDialogDemo_TermsOpen" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.FileText" OnClick="OnOpenTerms">Review the terms</DwsButton>
<DwsButton Name="CustomDialogDemo_TermsOpenFullScreen" Appearance="DwsAppearance.Outline" StartIcon="@Icons.BS.ArrowsFullscreen" OnClick="OnOpenTermsFullScreen">Review full screen</DwsButton>
</div>
<p class="mt-3 mb-0" aria-live="polite">@TermsResult</p>
<DwsDialog Name="CustomDialogDemo_TermsDialog" @bind-IsVisible="_termsVisible" Title="Terms of use" Options="@_termsOptions" MaxContentHeight="@_termsMaxContentHeight">
<DialogContent>
@foreach ((int number, string heading, string text) in TermsSections)
{
<DwsTypography @key="number" Name="@($"CustomDialogDemo_TermsHeading_{number}")" Typography="DwsTypographyType.Heading6">@heading</DwsTypography>
<DwsTypography @key="(number + 100)" Name="@($"CustomDialogDemo_TermsText_{number}")" Typography="DwsTypographyType.Paragraph">@text</DwsTypography>
}
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_TermsDecline" Appearance="DwsAppearance.Outline" OnClick="@(() => OnAnswerTerms(false))">Decline</DwsButton>
<DwsButton Name="CustomDialogDemo_TermsAccept" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" OnClick="@(() => OnAnswerTerms(true))">Accept</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _termsVisible;
private DwsDialogOptions _termsOptions = new();
private int? _termsMaxContentHeight;
private bool? _termsAccepted;
private DateTime _termsAnsweredAt;
private string TermsResult => _termsAccepted switch
{
null => "Not answered yet.",
true => $"Accepted at {_termsAnsweredAt:t}.",
false => "Declined - the terms were not accepted.",
};
private IEnumerable<(int Number, string Heading, string Text)> TermsSections =>
[
(1, "1. Scope", "These terms apply to every workspace you create or join in Example Cloud, on the web and in the apps."),
(2, "2. Your account", "Keep your password to yourself and tell us at once if you suspect misuse. You are responsible for what happens in your account."),
// ... six more: acceptable use, your content, fees and payment, availability, changes to these terms, termination.
];
// No close button, no Escape and no backdrop click: Accept or Decline is the only way out.
private void OnOpenTerms()
{
_termsOptions = new DwsDialogOptions { MaxWidth = MaxWidth.Medium, DisableBackdropClick = true, CloseButton = false, CloseOnEscapeKey = false };
_termsMaxContentHeight = 360;
_termsVisible = true;
}
private void OnOpenTermsFullScreen()
{
_termsOptions = new DwsDialogOptions { FullScreen = true, DisableBackdropClick = true, CloseButton = false, CloseOnEscapeKey = false };
_termsMaxContentHeight = null;
_termsVisible = true;
}
private void OnAnswerTerms(bool accepted)
{
_termsAccepted = accepted;
_termsAnsweredAt = DateTime.Now;
_termsVisible = false;
}Positions: a filter panel at the side or the bottom
DwsDialogOptions.Position anchors the dialog inside the viewport - CenterRight makes a side panel, BottomCenter a bottom sheet. On small screens the corner positions collapse to a centred, full-width sheet. Custom leaves the placement to your own CSS on .dws-dialog-custom .dws-dialog (this site puts it 5rem from the top left). The filters apply while you change them.
Showing 24 products, sorted by relevance.
Every position:Show Code
DialogCustom.razor
<div class="d-flex flex-wrap gap-2">
<DwsButton Name="CustomDialogDemo_FilterSide" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.Funnel" OnClick="@(() => OnOpenFilters(DialogPosition.CenterRight))">Filters as a side panel</DwsButton>
<DwsButton Name="CustomDialogDemo_FilterBottom" Appearance="DwsAppearance.Outline" StartIcon="@Icons.BS.Funnel" OnClick="@(() => OnOpenFilters(DialogPosition.BottomCenter))">Filters as a bottom sheet</DwsButton>
</div>
<p class="mt-3" aria-live="polite">@FilterSummary</p>
<DwsTypography Name="CustomDialogDemo_PositionsCaption" Typography="DwsTypographyType.Caption">Every position:</DwsTypography>
<div class="d-flex flex-wrap gap-2 mt-1">
@foreach (DialogPosition position in Enum.GetValues<DialogPosition>())
{
<DwsButton Name="@($"CustomDialogDemo_Position_{position}")" Appearance="DwsAppearance.Outline" OnClick="@(() => OnOpenFilters(position))">@position</DwsButton>
}
</div>
<DwsDialog Name="CustomDialogDemo_FilterDialog" @bind-IsVisible="_filterVisible" Title="Filters" Options="@_filterOptions">
<DialogContent>
<div class="d-flex flex-column gap-2">
<DwsSwitch Name="CustomDialogDemo_FilterInStock" Label="In stock only" @bind-Value="_filterInStock" />
<DwsTypography Name="CustomDialogDemo_FilterCategories" Typography="DwsTypographyType.Subtitle" Class="mt-2 mb-0">Categories</DwsTypography>
<DwsCheckBox Name="CustomDialogDemo_FilterLaptops" Label="Laptops" @bind-Checked="_filterLaptops" />
<DwsCheckBox Name="CustomDialogDemo_FilterMonitors" Label="Monitors" @bind-Checked="_filterMonitors" />
<DwsCheckBox Name="CustomDialogDemo_FilterAccessories" Label="Accessories" @bind-Checked="_filterAccessories" />
<DwsSelect Name="CustomDialogDemo_FilterSort" T="string" Label="Sort by" Class="mt-2" Options="@SortOptions" @bind-Value="_filterSort" />
</div>
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_FilterReset" Appearance="DwsAppearance.Text" StartIcon="@Icons.BS.ArrowCounterclockwise" OnClick="OnResetFilters">Reset</DwsButton>
<DwsButton Name="CustomDialogDemo_FilterApply" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" OnClick="OnCloseFilters">Show @FilteredCount products</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _filterVisible;
private DwsDialogOptions _filterOptions = new();
private bool _filterInStock;
private bool? _filterLaptops = true;
private bool? _filterMonitors = false;
private bool? _filterAccessories = false;
private string? _filterSort = "relevance";
// (The demo builds this list from its translations, once per language.)
private readonly List<DwsSelectOptionData<string>> SortOptions =
[
new() { Value = "relevance", Text = "relevance" },
new() { Value = "price", Text = "price, lowest first" },
new() { Value = "newest", Text = "newest first" },
];
private string SortText(string? value) => SortOptions.FirstOrDefault(option => option.Value == value)?.Text ?? value ?? string.Empty;
private void OnOpenFilters(DialogPosition position)
{
_filterOptions = new DwsDialogOptions
{
Position = position,
MaxWidth = MaxWidth.ExtraSmall,
FullWidth = true,
CloseButton = true,
CloseOnEscapeKey = true,
};
_filterVisible = true;
}
private void OnCloseFilters() => _filterVisible = false;
private void OnResetFilters()
{
_filterInStock = false;
_filterLaptops = false;
_filterMonitors = false;
_filterAccessories = false;
_filterSort = "relevance";
}
// A small fake catalogue: (total, in stock) per category; no category ticked counts all of them.
private int FilteredCount
{
get
{
(bool? Ticked, int Total, int InStock)[] categories = [(_filterLaptops, 24, 18), (_filterMonitors, 16, 9), (_filterAccessories, 52, 47)];
bool any = categories.Any(category => category.Ticked == true);
return categories
.Where(category => !any || category.Ticked == true)
.Sum(category => _filterInStock ? category.InStock : category.Total);
}
}
private string FilterSummary => $"Showing {FilteredCount} products, sorted by {SortText(_filterSort)}.";Full screen on phones: a message composer
FullScreenBelow = MD makes the dialog cover the whole viewport below 960px and leaves it a normal dialog above it - a form that is a dialog on a desktop and a page on a phone (narrow the window to see it).
No message sent yet.
Show Code
DialogCustom.razor
<DwsButton Name="CustomDialogDemo_ComposeOpen" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.PencilSquare" OnClick="OnOpenCompose">New message</DwsButton>
<p class="mt-3 mb-0" aria-live="polite">@ComposeResult</p>
<DwsDialog Name="CustomDialogDemo_ComposeDialog" @bind-IsVisible="_composeVisible" Title="New message" Options="@_composeOptions">
<DialogContent>
<div class="d-flex flex-column gap-3">
<DwsInput Name="CustomDialogDemo_ComposeTo" T="string" Label="To" @bind-Value="_composeTo" />
<DwsInput Name="CustomDialogDemo_ComposeSubject" T="string" Label="Subject" @bind-Value="_composeSubject" />
<DwsInput Name="CustomDialogDemo_ComposeBody" T="string" Label="Message" Lines="6" @bind-Value="_composeBody" />
</div>
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_ComposeDiscard" Appearance="DwsAppearance.Text" OnClick="OnDiscardCompose">Discard</DwsButton>
<DwsButton Name="CustomDialogDemo_ComposeSend" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" StartIcon="@Icons.BS.Send" Disabled="@string.IsNullOrWhiteSpace(_composeTo)" OnClick="OnSendCompose">Send</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _composeVisible;
// A dialog on a desktop, the whole screen below 960px.
private readonly DwsDialogOptions _composeOptions = new()
{
MaxWidth = MaxWidth.Medium,
FullWidth = true,
FullScreenBelow = DwsBreakpoint.MD,
CloseButton = true,
CloseOnEscapeKey = true,
InitialFocus = DwsDialogInitialFocus.FirstControl,
};
private string _composeTo = string.Empty;
private string _composeSubject = string.Empty;
private string _composeBody = string.Empty;
private string? _sentTo;
private string ComposeResult => _sentTo is null
? "No message sent yet."
: $"Message to {_sentTo} sent (demo: it never leaves the page).";
private void OnOpenCompose() => _composeVisible = true;
private void OnDiscardCompose()
{
ClearCompose();
_composeVisible = false;
}
private void OnSendCompose()
{
_sentTo = _composeTo.Trim();
ClearCompose();
_composeVisible = false;
}
private void ClearCompose()
{
_composeTo = string.Empty;
_composeSubject = string.Empty;
_composeBody = string.Empty;
}Moving and resizing: a notes window
Draggable lets the title bar move the dialog with mouse, pen or touch (it stays inside the viewport); Resizable adds the browser's resize grip in the bottom corner (desktop browsers). ShowMoveHandle (on by default) adds the keyboard handle at the start of the title bar: arrow keys move, Shift + arrow keys resize, Home puts the window back.
7 words in your notes.
Show Code
DialogCustom.razor
<div class="d-flex flex-wrap align-items-center gap-3">
<DwsButton Name="CustomDialogDemo_NotesOpen" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.Pencil" OnClick="OnOpenNotes">Meeting notes</DwsButton>
<DwsSwitch Name="CustomDialogDemo_NotesMoveHandle" Label="Keyboard move handle" @bind-Value="_notesMoveHandle" />
</div>
<p class="mt-3 mb-0" aria-live="polite">@NotesSummary</p>
<DwsDialog Name="CustomDialogDemo_NotesDialog" @bind-IsVisible="_notesVisible" Title="Meeting notes" Options="@_notesOptions">
<DialogContent>
<DwsInput Name="CustomDialogDemo_NotesText" T="string" Label="Notes" Lines="8" @bind-Value="_notes" />
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_NotesDone" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" OnClick="OnCloseNotes">Done</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _notesVisible;
private bool _notesMoveHandle = true;
private DwsDialogOptions _notesOptions = new();
private string _notes = "Agenda: release date, onboarding redesign, hiring plan.";
private string NotesSummary => $"{WordCount(_notes)} words in your notes.";
private void OnOpenNotes()
{
// Moved by its title bar, resized by the grip in its bottom corner; the move handle is the keyboard way to do both.
_notesOptions = new DwsDialogOptions
{
Draggable = true,
Resizable = true,
ShowMoveHandle = _notesMoveHandle,
Position = DialogPosition.TopRight,
MaxWidth = MaxWidth.Small,
FullWidth = true,
CloseButton = true,
CloseOnEscapeKey = true,
};
_notesVisible = true;
}
private void OnCloseNotes() => _notesVisible = false;
private static int WordCount(string text) =>
text.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries).Length;Live title: upload progress
The dialog writes its progress into its own TitleContent while the upload runs. The title bar lives in the hosting dialog instance; DwsDialog forwards a changed title to it, so the component only re-renders itself. DisableBackdropClick keeps a stray click from hiding a running upload.
Nothing uploaded yet.
Show Code
DialogCustom.razor
@inject IDwsDialogService DialogService
<DwsButton Name="CustomDialogDemo_UploadOpen" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.CloudArrowUp" OnClick="OnUploadAsync">Upload @UploadFiles.Length files</DwsButton>
<p class="mt-3 mb-0" aria-live="polite">@UploadResult</p>DialogCustom.razor.cs
private static readonly string[] UploadFiles = ["site-photos.zip", "brand-guide.pdf", "Q4 budget.xlsx"];
private int? _uploadedCount;
private bool _uploadCancelled;
private string UploadResult => _uploadCancelled
? "Upload cancelled."
: _uploadedCount is null ? "Nothing uploaded yet." : $"{_uploadedCount} files uploaded.";
private async Task OnUploadAsync()
{
DwsDialogParameters parameters = new()
{
{ "Name", "CustomDialogDemo_UploadDialog" },
{ "FileNames", UploadFiles },
};
// The title passed here is only the fallback: the dialog's TitleContent wins.
DwsDialogOptions options = new() { MaxWidth = MaxWidth.Small, FullWidth = true, DisableBackdropClick = true };
IDwsDialogReference dialog = DialogService.Show<DemoDialogUpload>("Upload", parameters, options);
DwsDialogResult result = await dialog.Result;
_uploadCancelled = result.Cancelled;
_uploadedCount = result.Cancelled ? null : result.Data as int?;
}DemoDialogUpload.razor
@* DemoDialogContentBase = DwsBaseBlazorComponent + [CascadingParameter] DwsDialogInstance? InstanceDialog
(the hosting dialog: Close(result) / Cancel()) + T(key, fallback) for the demo texts. *@
@inherits DemoDialogContentBase
<DwsDialog Name="@($"{Name}_Dialog")" TitleContent="@UploadTitle">
<DialogContent>
<DwsProgressBar Name="@($"{Name}_Progress")" Progress="@_progress" AriaLabel="Upload progress" />
<DwsTypography Name="@($"{Name}_Files")" Typography="DwsTypographyType.Paragraph" Class="mt-3 mb-1">@FilesDone of @FileNames.Count files uploaded</DwsTypography>
<DwsTypography Name="@($"{Name}_FileNames")" Typography="DwsTypographyType.Caption">@string.Join(" · ", FileNames)</DwsTypography>
</DialogContent>
<DialogActions>
@if (IsComplete)
{
<DwsButton Name="@($"{Name}_Done")" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" OnClick="OnDone">Done</DwsButton>
}
else
{
<DwsButton Name="@($"{Name}_Cancel")" Appearance="DwsAppearance.Text" OnClick="OnCancel">Cancel upload</DwsButton>
}
</DialogActions>
</DwsDialog>DemoDialogUpload.razor.cs
public partial class DemoDialogUpload : DemoDialogContentBase
{
[Parameter]
public IReadOnlyList<string> FileNames { get; set; } = [];
private readonly CancellationTokenSource _cts = new();
private double _progress;
private bool _disposed;
private bool IsComplete => _progress >= 100;
private int FilesDone => FileNames.Count == 0 ? 0 : (int)Math.Floor(_progress / (100d / FileNames.Count));
private string? _titleText;
private RenderFragment? _titleFragment;
// The title bar belongs to the hosting dialog instance; DwsDialog forwards a changed TitleContent to it, so a plain
// re-render of this component updates the title. A new fragment only when the text changed: DwsDialog compares the
// fragment by reference and re-renders the instance (and with it this body) for every new one.
private RenderFragment UploadTitle
{
get
{
string text = IsComplete ? "Upload complete" : $"Uploading {FileNames.Count} files · {(int)_progress} %";
if (_titleFragment is null || !string.Equals(text, _titleText, StringComparison.Ordinal))
{
_titleText = text;
_titleFragment = builder =>
{
builder.OpenElement(0, "strong");
builder.AddContent(1, text);
builder.CloseElement();
};
}
return _titleFragment;
}
}
protected override async Task AfterRenderAsyncCallback(bool firstRender)
{
await base.AfterRenderAsyncCallback(firstRender);
if (firstRender)
{
_ = RunUploadAsync();
}
}
private void OnDone() => InstanceDialog?.Close(DwsDialogResult.Ok(FileNames.Count));
private void OnCancel() => InstanceDialog?.Cancel();
private async Task RunUploadAsync()
{
try
{
while (!IsComplete)
{
await Task.Delay(250, _cts.Token);
await InvokeAsync(() =>
{
_progress = Math.Min(100, _progress + 4);
StateHasChanged();
});
}
}
catch (OperationCanceledException)
{
// The dialog was closed while the upload ran - nothing to do.
}
catch (ObjectDisposedException)
{
// The dialog was disposed while the upload ran - nothing to do.
}
}
protected override void Dispose(bool disposing)
{
if (!_disposed)
{
if (disposing)
{
_cts.Cancel();
_cts.Dispose();
}
_disposed = true;
}
base.Dispose(disposing);
}
}Sizes
DwsDialogOptions.MaxWidth picks the breakpoint of the dialog surface; FullWidth stretches the dialog to that breakpoint even when its content is narrower.
Show Code
DialogCustom.razor
<div class="d-flex flex-wrap gap-2">
@foreach (MaxWidth maxWidth in Enum.GetValues<MaxWidth>())
{
<DwsButton Name="@($"CustomDialogDemo_MaxWidth_{maxWidth}")" Appearance="DwsAppearance.Outline" OnClick="@(() => OnOpenSized(maxWidth))">@maxWidth</DwsButton>
}
</div>
<DwsSwitch Name="CustomDialogDemo_FullWidth" Label="FullWidth" Class="mt-3" @bind-Value="_sizeFullWidth" />
<DwsDialog Name="CustomDialogDemo_SizeDialog" @bind-IsVisible="_sizeVisible" Title="@($"MaxWidth.{_sizeMaxWidth}")" Options="@_sizeOptions">
<DialogContent>
<DwsTypography Name="CustomDialogDemo_SizeText" Typography="DwsTypographyType.Paragraph" Class="mb-0">ExtraSmall suits a one-line question, Small and Medium a form, Large and wider a table, a preview or an editor.</DwsTypography>
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_SizeClose" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" OnClick="OnCloseSized">Close</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _sizeVisible;
private bool _sizeFullWidth = true;
private MaxWidth _sizeMaxWidth = MaxWidth.Small;
private DwsDialogOptions _sizeOptions = new();
private void OnOpenSized(MaxWidth maxWidth)
{
_sizeMaxWidth = maxWidth;
_sizeOptions = new DwsDialogOptions
{
MaxWidth = maxWidth,
FullWidth = _sizeFullWidth,
CloseButton = true,
CloseOnEscapeKey = true,
};
_sizeVisible = true;
}
private void OnCloseSized() => _sizeVisible = false;Closing and the title bar
Switch the options, then open the help dialog. CloseOnEscapeKey cancels on Escape, CloseButton adds the close button, DisableBackdropClick keeps the dialog open when the backdrop is clicked and NoHeader removes the title bar. IsVisibleChanged reports every close of the inline dialog, so the page can tell the Got it button from a cancel.
Not opened yet.
Show Code
DialogCustom.razor
<div class="d-flex flex-wrap gap-3">
<DwsSwitch Name="CustomDialogDemo_CloseOnEscape" Label="CloseOnEscapeKey" @bind-Value="_closeOnEscape" />
<DwsSwitch Name="CustomDialogDemo_CloseButton" Label="CloseButton" @bind-Value="_closeButton" />
<DwsSwitch Name="CustomDialogDemo_DisableBackdrop" Label="DisableBackdropClick" @bind-Value="_disableBackdrop" />
<DwsSwitch Name="CustomDialogDemo_NoHeader" Label="NoHeader" @bind-Value="_noHeader" />
</div>
<DwsButton Name="CustomDialogDemo_ShortcutsOpen" Appearance="DwsAppearance.Filled" StartIcon="@Icons.BS.Keyboard" Class="mt-3" OnClick="OnOpenShortcuts">Keyboard shortcuts</DwsButton>
<p class="mt-3 mb-0" aria-live="polite">@ShortcutsResult</p>
<DwsDialog Name="CustomDialogDemo_ShortcutsDialog" IsVisible="_shortcutsVisible" IsVisibleChanged="OnShortcutsVisibleChanged" Title="Keyboard shortcuts" Options="@_shortcutsOptions">
<DialogContent>
@foreach ((string keys, string action) in Shortcuts)
{
<div class="d-flex justify-content-between gap-4 py-1">
<kbd>@keys</kbd>
<span>@action</span>
</div>
}
</DialogContent>
<DialogActions>
<DwsButton Name="CustomDialogDemo_ShortcutsGotIt" Appearance="DwsAppearance.Filled" Color="DwsColor.Primary" OnClick="OnShortcutsGotIt">Got it</DwsButton>
</DialogActions>
</DwsDialog>DialogCustom.razor.cs
private bool _closeOnEscape = true;
private bool _closeButton = true;
private bool _disableBackdrop;
private bool _noHeader;
private bool _shortcutsVisible;
private DwsDialogOptions _shortcutsOptions = new();
private bool? _shortcutsConfirmed;
private readonly (string Keys, string Action)[] Shortcuts =
[
("Ctrl + S", "Save"),
("Ctrl + K", "Search"),
("Ctrl + Z", "Undo"),
("?", "Show this help"),
];
private string ShortcutsResult => _shortcutsConfirmed switch
{
null => "Not opened yet.",
true => "Closed with Got it.",
false => "Cancelled - by Escape, the close button or a click on the backdrop.",
};
private void OnOpenShortcuts()
{
_shortcutsOptions = new DwsDialogOptions
{
CloseOnEscapeKey = _closeOnEscape,
CloseButton = _closeButton,
DisableBackdropClick = _disableBackdrop,
NoHeader = _noHeader,
MaxWidth = MaxWidth.ExtraSmall,
FullWidth = true,
};
_shortcutsVisible = true;
}
private void OnShortcutsGotIt()
{
_shortcutsConfirmed = true;
_shortcutsVisible = false;
}
// Raised on every change of the open state. Still open here = the dialog closed itself: a cancel.
private void OnShortcutsVisibleChanged(bool visible)
{
if (!visible && _shortcutsVisible)
{
_shortcutsVisible = false;
_shortcutsConfirmed = false;
}
}Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| IsInline | bool | - | True when the dialog is declared inline instead of being hosted by a dialog instance. |
| Options.Position | DialogPosition? | Center | Where the dialog is anchored inside the viewport. |
| Options.MaxWidth | MaxWidth? | Small | Max width breakpoint of the dialog surface. |
| Options.FullWidth | bool? | false | Stretches the dialog to the width of its MaxWidth breakpoint. |
| Options.FullScreen | bool? | false | Renders the dialog across the whole viewport. |
| Options.CloseOnEscapeKey | bool? | false | Cancels the dialog when Escape is pressed. |
| Options.CloseButton | bool? | false | Shows a close button in the title bar. |
| Options.NoHeader | bool? | false | Renders the dialog without its title bar. |
| Options.DisableBackdropClick | bool? | false | Keeps the dialog open when the backdrop is clicked. |
| Options.FullScreenBelow | DwsBreakpoint? | null | Makes the dialog cover the whole viewport on screens narrower than the breakpoint (SM 600px, MD 960px, LG 1280px, XL 1920px, XXL 2560px) and leaves it a normal dialog above it. Null or XS: never. |
| Options.InitialFocus | DwsDialogInitialFocus? | Dialog | Where the focus goes on opening: Dialog (the dialog itself, so its title is announced) or FirstControl (the first control of the content or actions, not the title bar's close button). An element marked data-dws-dialog-initial-focus or autofocus wins in both modes. |
| Options.Draggable | bool? | false | Lets the user move the dialog by its title bar with mouse, pen or touch; it stays inside the viewport. Needs the title bar; ignored by a full-screen dialog. Controls in the title bar and elements marked data-dws-dialog-no-drag keep their own presses. |
| Options.Resizable | bool? | false | Lets the user resize the dialog by the browser's resize grip in its bottom corner, up to its MaxWidth and the viewport. Desktop browsers only (touch browsers show no grip). |
| Options.ShowMoveHandle | bool? | true | Shows the keyboard handle of a Draggable or Resizable dialog: a small button at the start of the title bar. While it has the focus the arrow keys move the dialog (16 px a press), Shift + arrow keys resize it, Home puts it back where it opened; the result is announced. Needs the title bar. |
| Provider.DismissOnNavigation | bool | true | Closes every dialog when the user navigates to another page. |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| Show | IDwsDialogReference | Opens an inline dialog through the dialog service. | |
| Close | void | Closes the currently open inline dialog. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Title | string? | null | Plain text title. Overrides the title passed to DialogService.Show(...). |
| TitleContent | RenderFragment? | null | Title markup (overrides Title). Changes are forwarded to the hosting dialog instance. |
| DialogContent | RenderFragment? | null | The dialog body. |
| DialogActions | RenderFragment? | null | Action buttons rendered in the footer bar. |
| Options | DwsDialogOptions? | null | Default options used by Show() on an inline dialog. |
| DisableSidePadding | bool | false | Removes the horizontal padding of the dialog body. |
| ClassContent | string | string.Empty | CSS class applied to the dialog body. |
| ClassActions | string | string.Empty | CSS class applied to the action button container. |
| ContentStyle | string | string.Empty | Inline styles applied to the dialog body. |
| MaxContentHeight | int? | null | Maximum height of the dialog body in pixels. The body scrolls beyond it. |
| IsVisible | bool | false | Two way bound open state of an inline dialog. |
| AlertDialog | bool | false | Marks the dialog as an alert dialog (role="alertdialog"): a confirmation or warning that needs an answer. Its content is then also its accessible description. |
| InlineSource | DwsDialog? | null | Set by an inline dialog on the copy it opens through the dialog service: the copy takes every parameter from it, and again whenever the page renders the inline dialog. Not set by an application. |
| Name | Typ | Description |
|---|---|---|
| OnBackdropClick | EventCallback<MouseEventArgs> | Raised when the backdrop is clicked. Without a handler the dialog is cancelled. |
| OnKeyDown | EventCallback<KeyboardEventArgs> | Raised when a key is pressed inside the dialog body. |
| OnKeyUp | EventCallback<KeyboardEventArgs> | Raised when a pressed key is released inside the dialog body. |
| IsVisibleChanged | EventCallback<bool> | Raised when the inline dialog's display status changes. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Element | ElementReference | The associated web component. May be null if accessed before the component is rendered. | |
| ComponentGuid | Guid | Unique identifier for the component. | |
| TypeString | string | The name of the component type, obtained from reflection. | |
| Authorized_RegisterEnabled | bool | false | Indicates whether this component is enabled through a permission registry. |
| Authorized_RegisterSelected | bool | false | Indicates whether this component is selected in permission selection mode. |
| GetInitializedState | bool | false | Returns whether the component is initialized. |
| GetRenderModeState | DwsRenderMode | Returns the current render mode. | |
| GetComponentState | DwsComponentStateType | Returns the current component state. | |
| GetIsInteractiveState | bool | false | Returns whether the component is interactive. |
| GetIsPrerenderingState | bool | false | Returns whether the component is prerendering. |
| GetComponentLoadingState | bool | false | Returns whether the component is loading. |
| IsFormBusy | bool | false | Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState). |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| DebugInfo | void | Logs debug information about the component. | |
| UpdateState | void | Updates the component's state and triggers StateHasChanged. | |
| UpdateStateAsync | Task | Asynchronously updates the component's state and triggers StateHasChanged. | |
| Dispose | void | Disposes the component and releases resources. | |
| FocusAsync | ValueTask | bool containedInScrollableList | Sets focus to the component's element. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Name | string | Required unique identifier for the component within its container. | |
| Visible | bool | true | Determines if the component is visible in the UI. |
| Disabled | bool | false | Disables the form control, ensuring it doesn't participate in form submission. |
| ComponentNameSpace | string | The namespace for permission-based access control. | |
| PermissionKey | string? | null | A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins. |
| Class | string | Optional CSS class names. | |
| Style | string | Optional in-line styles. | |
| Tag | object | An optional user-defined object to store any additional data with the component. | |
| BackReference | DwsReference | A reference to the enclosing component. | |
| ID | string | The HTML ID attribute for the component. | |
| AdditionalAttributes | Dictionary<string, object> | Additional HTML attributes for the component's root element. | |
| IgnorePermissionChecks | bool | false | Bypasses all permission checks for this component. |
| IgnorePermissionSelection | bool | false | Ignore permission selection mode for this component. |
| IgnoreFormBusy | bool | false | Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it. |
| Name | Typ | Description |
|---|---|---|
| OnInitializedCallbackStarted | EventCallback | Callback when OnInitialized starts. |
| OnInitializedCallback | EventCallback | Callback during OnInitialized. |
| OnInitializedCallbackCompleted | EventCallback | Callback when OnInitialized completes. |
| OnInitializedAsyncCallbackStarted | EventCallback | Callback when OnInitializedAsync starts. |
| OnInitializedAsyncCallback | EventCallback | Callback during OnInitializedAsync. |
| OnInitializedAsyncCallbackCompleted | EventCallback | Callback when OnInitializedAsync completes. |
| OnIsComponentLoadingChanged | EventCallback<bool> | Callback when IsComponentLoading changes. |
| OnCurrentRenderModeChanged | EventCallback<DwsRenderMode> | Callback when CurrentRenderMode changes. |
| OnComponentStateChanged | EventCallback<DwsComponentStateType> | Callback when ComponentState changes. |
