Files
webwindowconfigurator/WebWindowConfigurator/WebWindowMaker.razor.cs
T
2025-07-14 12:03:36 +02:00

58 lines
1.7 KiB
C#

using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using System.Runtime.Intrinsics.X86;
using System.Text.Json.Serialization;
using WebWindowConfigurator.Json;
namespace WebWindowConfigurator
{
public partial class WebWindowMaker
{
#region Public Properties
[Parameter]
public string CurrJwd { get; set; } = null!;
[Parameter]
public EventCallback<bool> EC_Close { get; set; }
[Parameter]
public EventCallback<string> EC_Update { get; set; }
#endregion Public Properties
#region Protected Methods
protected async Task DoClose()
{
await EC_Close.InvokeAsync(true);
}
protected async Task DoSave()
{
var CurrentWindow = new JsonWindow("Profilo68");
var Frame = new JsonFrame(CurrWindow.Forma, false, 0);
Frame.DimensionList.Add(new JsonFrameDimension(1, "Larghezza", CurrWindow.Larghezza));
Frame.DimensionList.Add(new JsonFrameDimension(1, "Altezza", CurrWindow.Altezza));
Frame.AreaList.Add(new JsonSash(true, WindowConst.SashTypes.ACTIVE, ""));
CurrentWindow.AreaList.Add(Frame);
//CurrJwd = @"prova";
CurrJwd = JsonConvert.SerializeObject(CurrentWindow, Formatting.Indented);
await EC_Update.InvokeAsync(CurrJwd);
}
public class WindowDto
{
public double Altezza { get; set; } = 1200;
public double Larghezza { get; set; } = 800;
public WindowConst.Shapes Forma { get; set; } = WindowConst.Shapes.RECTANGLE;
}
protected WindowDto CurrWindow { get; set; } = new WindowDto();
#endregion Protected Methods
}
}