Created first component

This commit is contained in:
Holger Börchers 2020-08-23 21:09:05 +02:00
parent f2932ad2e8
commit 90ec5036bf
4 changed files with 24 additions and 24 deletions

Binary file not shown.

View File

@ -48,7 +48,7 @@ else
</Button>
</SaveCommandTemplate>
<CancelCommandTemplate>
<Button Color="Color.Danger" Clicked="@context.Clicked" title="Cancel editing">
<Button Color="Color.Secondary" Clicked="@context.Clicked" title="Cancel editing">
<i class="far fa-times-circle"></i>
</Button>
</CancelCommandTemplate>

View File

@ -49,7 +49,7 @@ else
</Button>
</SaveCommandTemplate>
<CancelCommandTemplate>
<Button Color="Color.Danger" Clicked="@context.Clicked" title="Cancel editing">
<Button Color="Color.Secondary" Clicked="@context.Clicked" title="Cancel editing">
<i class="far fa-times-circle"></i>
</Button>
</CancelCommandTemplate>
@ -100,31 +100,11 @@ else
</DataGridSelectColumn>
<DataGridCheckColumn TItem="User" Field="@nameof(User.IsActive)" Caption="Active" Editable="true" >
<DisplayTemplate>
@{
if(((User) context ).IsActive){
<span style="color: green;">
<i class="far fa-check-circle"></i>
</span>
} else {
<span style="color: red;">
<i class="fas fa-ban"></i>
</span>
}
}
<UserIsActive IsActive="@(((User)context).IsActive)" />
</DisplayTemplate>
<EditTemplate>
<Switch TValue="bool" Checked="@((bool)(context.CellValue))" CheckedChanged="@(v => context.CellValue = v)">
@{
if((bool)(context.CellValue)){
<span style="color: green;">
<i class="far fa-check-circle"></i>
</span>
} else {
<span style="color: red;">
<i class="fas fa-ban"></i>
</span>
}
}
<UserIsActive IsActive="@((bool)(context.CellValue))" />
</Switch>
</EditTemplate>
</DataGridCheckColumn>

View File

@ -0,0 +1,20 @@
@{
if(IsActive)
{
<span style="color: green;">
<i class="far fa-check-circle"></i>
</span>
}
else
{
<span style="color: red;">
<i class="fas fa-ban"></i>
</span>
}
}
@code {
[Parameter]
public bool IsActive { get; set; }
}