Files
webwindowconfigurator/WebWindowConfigurator/WebWindowMaker.razor.cs
T
Annamaria Sassi 62da66f446 - aggiunto newtonsoft json
- aggiunto interazione bottoni
- aggiunto esempio dati nella grafica
- aggiunte classi per serializzazione finestra
2025-07-11 19:04:16 +02:00

46 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
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(WindowConst.Shapes.RECTANGLE, false, 0);
Frame.DimensionList.Add(new JsonFrameDimension(1, "Larghezza", 800));
Frame.DimensionList.Add(new JsonFrameDimension(1, "Altezza", 1200));
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);
}
#endregion Protected Methods
}
}