HxDialogBase #

Base class to simplify custom modal dialog implementation.

Implementation #

Use HxModal with @ref="modal" inside the dialog. See demo.

How to use a custom dialog #

Successful:

Dice number:

How to implement a custom dialog #

@inherits HxDialogBase<int>

<HxModal Title="What is on your dice?" @ref="modal"> @* @ref="modal" is required by HxDialogBase<> *@
	<BodyTemplate>
		<HxButton Text="1" Color="ThemeColor.Secondary" OnClick="async () => await HideAsync(1)" />
		<HxButton Text="2" Color="ThemeColor.Secondary" OnClick="async () => await HideAsync(2)" />
		<HxButton Text="3" Color="ThemeColor.Secondary" OnClick="async () => await HideAsync(3)" />
		<HxButton Text="4" Color="ThemeColor.Secondary" OnClick="async () => await HideAsync(4)" />
		<HxButton Text="5" Color="ThemeColor.Secondary" OnClick="async () => await HideAsync(5)" />
		<HxButton Text="6" Color="ThemeColor.Secondary" OnClick="async () => await HideAsync(6)" />
	</BodyTemplate>
	<FooterTemplate>
		<HxButton Text="Close" Color="ThemeColor.Secondary" OnClick="async () => await HideAsCancelledAsync()" />
	</FooterTemplate>
</HxModal>

API #

Methods #

Method Returns Description
ShowAsync() Task<DialogResult<TResult>> Shows the modal and waits until it is hidden.
An unhandled error has occurred. Reload 🗙