Aggiunta componente indipendente per Area Split
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<div class="border mb-2 shadow-sm rounded">
|
||||
<div class="card-body py-2">
|
||||
<div class="row my-2">
|
||||
<div class="col-sm-4 justify-content-center">
|
||||
@if (CurrSplittedList.Count > 1)
|
||||
{
|
||||
<h3 class="card-title text-center">Area split @(CurrSplittedList.IndexOf(CurrSplitted) + 1)</h3>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h3 class="card-title text-center">Area split</h3>
|
||||
}
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CurrSplitted.AddFirstSash()">Add sash</button>
|
||||
</div>
|
||||
</div>
|
||||
@for (int j = 0; j < CurrSashList.Count; j++)
|
||||
{
|
||||
int Index = j;
|
||||
<div class="col-4">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => RaiseCopySash(Index)">Copy sash @(CurrSashList.Count == 1 ? "" : (Index + 1))</button>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebWindowComplex
|
||||
{
|
||||
public partial class AreaSplit
|
||||
{
|
||||
[Parameter]
|
||||
public List<Splitted> CurrSplittedList { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public List<Sash> CurrSashList { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public Splitted CurrSplitted { get; set; } = null;
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<int> EC_CopySash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Sollevo evento richiesta copia sash
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private async Task RaiseCopySash(int indexCurrSash)
|
||||
{
|
||||
await EC_CopySash.InvokeAsync(indexCurrSash);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -737,12 +737,10 @@
|
||||
</div>
|
||||
</div>
|
||||
@foreach (var currSplitted in SplittedList)
|
||||
@* @for (int i = 0; i < SplittedList.Count; i++) *@
|
||||
{
|
||||
@* Splitted currSplitted = SplittedList[i]; *@
|
||||
@if (currSplitted.AreaList[0].Equals(item))
|
||||
{
|
||||
<div class="border mb-2 shadow-sm rounded">
|
||||
@* <div class="border mb-2 shadow-sm rounded">
|
||||
<div class="card-body py-2">
|
||||
<div class="row my-2">
|
||||
<div class="col-sm-4 justify-content-center">
|
||||
@@ -761,9 +759,7 @@
|
||||
</div>
|
||||
</div>
|
||||
@foreach (var Index in SashList)
|
||||
@* @for (int j = 0; j < SashList.Count; j++) *@
|
||||
{
|
||||
@* int Index = j; *@
|
||||
<div class="col-4">
|
||||
<div class="input-group mb-2 justify-content-center">
|
||||
<button class="btn btn-outline-secondary btn-sm" @onclick="() => CopySash(currSplitted, SashList.IndexOf(Index))">Copy sash @(SashList.Count == 1 ? "" : (SashList.IndexOf(Index) + 1))</button>
|
||||
@@ -772,7 +768,8 @@
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *@
|
||||
<AreaSplit CurrSashList="SashList" CurrSplittedList="SplittedList" CurrSplitted="currSplitted" EC_CopySash="() => CopySash()"></AreaSplit>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -30,3 +30,4 @@
|
||||
|
||||
</Project>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user