35 lines
572 B
Plaintext
35 lines
572 B
Plaintext
<div class="action-box" @onclick="AsyncInvocation">
|
|
@ChildContent
|
|
</div>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
[Parameter]
|
|
public Action? Action { get; set; }
|
|
|
|
private async void AsyncInvocation()
|
|
{
|
|
if (Action == null) return;
|
|
await Task.Run(Action);
|
|
}
|
|
}
|
|
|
|
<style>
|
|
|
|
.action-box
|
|
{
|
|
padding: 5px;
|
|
text-align: center;
|
|
background: rgb(143,134,191);
|
|
color: #d7d7d7;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.action-box:hover {
|
|
box-shadow: 0 0 15px #736d6d;
|
|
color: white;
|
|
}
|
|
|
|
</style> |