GridRowContent - fixed Collapsable

pull/13/head
markosteger 2 years ago
parent 402e904b10
commit f770bd26bc

@ -22,4 +22,9 @@
<Watch Remove="..\..\src\**\bin\**" />
</ItemGroup>
<ItemGroup>
<Watch Remove="Program.cs" />
</ItemGroup>
</Project>

@ -4,9 +4,20 @@
<h1 style="text-align:center;">Component Sandbox</h1>
<DatePicker @bind-SelectedDate=date>
</DatePicker>
<Grid>
@for (int i = 0; i < 5; i++)
{
int num = i;
<GridRow>
<GridRowContent>
Fixed content @num.ToString()
</GridRowContent>
<GridRowContent Collapsable=true>
Collapsable content @num.ToString()
</GridRowContent>
</GridRow>
}
</Grid>
<p>Izbran datum je: @date</p>

@ -26,15 +26,22 @@ public partial class GridRowContent : ComponentBase
{
get
{
return new CssBuilder("row")
.AddClass("collapsed", Collapsable)
.AddClass("show", (Collapsable ? Parent?.CollapsedItemShown : false))
.Build();
CssBuilder cssBuilder = new CssBuilder("row");
cssBuilder.AddClass("collapsed", Collapsable);
if (Parent is not null)
{
cssBuilder.AddClass("show", (Collapsable ? Parent.CollapsedItemShown : false));
}
return cssBuilder.Build();
}
}
protected override async Task OnInitializedAsync()
{
if (Parent is not null)
{
if (Parent.Children is null) Parent.Children = new();

@ -0,0 +1,23 @@
using System.ComponentModel;
namespace Connected;
public enum Theme
{
[Description("")]
Default,
[Description("dark")]
Dark,
[Description("light")]
Light,
[Description("pink")]
Pink
}
public static class ThemeProvider
{
public static Theme theme { get; set; } = Theme.Default;
}
Loading…
Cancel
Save