You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Connected.Components/Components/MessageBox/MessageBox.razor

63 lines
1.8 KiB

2 years ago
@namespace Connected.Components
@inherits UIComponent
<Dialog @attributes="UserAttributes">
<TitleContent>
@if (TitleContent == null)
{
<TextContent Typo="Typo.h6">@Title</TextContent> }
else
{
@TitleContent
}
</TitleContent>
<DialogContent>
@if(MessageContent!=null)
{
@MessageContent
}
else
{
@MarkupMessage
@Message
}
</DialogContent>
<DialogActions>
<div tabindex="-1" @onkeydown="HandleKeyDown">
<FocusTrap DefaultFocus="DefaultFocus.LastChild">
@if (CancelButton != null)
{
<CascadingValue Value="@_cancelCallback">
@CancelButton
</CascadingValue>
}
else if (!string.IsNullOrWhiteSpace(CancelText))
{
<Button OnClick="OnCancelClicked">@CancelText</Button>
}
@if (NoButton != null)
{
<CascadingValue Value="@_noCallback">
@NoButton
</CascadingValue>
}
else if (!string.IsNullOrWhiteSpace(NoText))
{
<MudButton OnClick="OnNoClicked">@NoText</MudButton>
}
@if (YesButton != null)
{
<CascadingValue Value="@_yesCallback">
@YesButton
</CascadingValue>
}
else if (!string.IsNullOrWhiteSpace(YesText))
{
<Button Color="ThemeColor.Primary" OnClick="OnYesClicked">@YesText</Button>
}
</FocusTrap>
</div>
</DialogActions>
</Dialog>