From 4e98d63c899d5914cbbde0a777e964cde4d3c973 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 14 Jul 2025 12:03:36 +0200 Subject: [PATCH] Fix bind oggetti --- WebWindowConfigurator/WebWindowMaker.razor | 10 +++++----- WebWindowConfigurator/WebWindowMaker.razor.cs | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/WebWindowConfigurator/WebWindowMaker.razor b/WebWindowConfigurator/WebWindowMaker.razor index a9bbda5..aad5090 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor +++ b/WebWindowConfigurator/WebWindowMaker.razor @@ -8,25 +8,25 @@
Altezza - + mm
Larghezza - + mm
Forma - +
Numero ante - +
Altezza maniglia - + mm
diff --git a/WebWindowConfigurator/WebWindowMaker.razor.cs b/WebWindowConfigurator/WebWindowMaker.razor.cs index 3227d05..84c9dcb 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor.cs +++ b/WebWindowConfigurator/WebWindowMaker.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using Newtonsoft.Json; +using System.Runtime.Intrinsics.X86; using System.Text.Json.Serialization; using WebWindowConfigurator.Json; @@ -30,9 +31,9 @@ namespace WebWindowConfigurator 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)); + 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); @@ -41,6 +42,17 @@ namespace WebWindowConfigurator 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 } } \ No newline at end of file