+
+ @if (currStep == CompileStep.Template)
+ {
+
+
+
+ | # |
+ Image |
+ Description |
+
+
+
+ @foreach (var item in IN_TemplateDTOList)
{
-
-
-
- Numero
-
-
-
-
-
-
- @foreach (var dim in item.SplitPositionList)
- {
-
- Altezza area inferiore
-
-
- }
-
-
+ string colorClass = "";
+ @if (SelTemplateDTO != null && item.Index == SelTemplateDTO.Index)
+ colorClass = "table-success";
+ else
+ colorClass = "";
+ DoSelect(item)">
+ | @item.Index |
+  |
+ @item.Description |
+
}
- @* *@
-
-
-
- @*img*@
-
-
-
- }
- else if (currStep == CompileStep.Sash)
- {
-
-
-
-
- @foreach (var item in SashList)
- {
-
+
+
+ @*
*@
+ }
+ else if (currStep == CompileStep.Frame)
+ {
+
+
+
+
-
-
-
Orientamento
-
-
-
-
-
-
-
-
-
-
- @foreach (SashDimension sash in item.SashList)
- {
-
Apertura
-
-
-
-
-
- Dimensione
-
-
+
Dimensioni
+ @foreach (FrameDimension dimension in m_Frame.DimensionList)
+ {
+
+ @dimension.nIndex
+ @dimension.sName
+
+
+ }
+
+
+
+
+
Giunzioni telaio
+ @foreach (Joint joint in m_Frame.JointList)
+ {
+
+
+
+
+ }
+
+
+
+
+
Bottom rail
+
+ Quantità
+
+
+
+
+ @*
*@
+
+
+
+ @*img*@
+
+
+
+ }
+ else if (currStep == CompileStep.Split)
+ {
+
+
+
+
+ @foreach (var item in SplitList)
+ {
+
+
+
+ Numero
+
+
+
+
+
+
+ @foreach (var dim in item.SplitPositionList)
+ {
+
+ Altezza area inferiore
+
+
+ }
+
+
+ }
+ @*
*@
+
+
+
+ @*img*@
+
+
+
+ }
+ else if (currStep == CompileStep.Sash)
+ {
+
+
+
+
+ @foreach (var item in SashList)
+ {
+
+
-
- }
-
-
-
Giunzioni ante
- @foreach (Joint joint in item.JointList)
+ @foreach (SashDimension sash in item.SashList)
{
-
-
-
-
-
Bottom rail
-
-
-
-
-
-
+
+
+
Giunzioni ante
+ @foreach (Joint joint in item.JointList)
+ {
+
+
+
+
+ }
-
+ }
+
+ @*
*@
- }
-
- @*
*@
+
+
+ @* img *@
+
-
- @* img *@
-
-
-
- }
- else if (currStep == CompileStep.Fill)
- {
-
-
-
-
- @foreach (var Fill in FillList)
- {
-
-
-
Riempimento
-
+
+ @*img*@
+
-
- @*img*@
-
-
+ }
- }
-
-
-
-
+
+
+ @if (SelTemplateDTO != null)
+ {
+
+ @outSvg
+
+ }
diff --git a/WebWindowConfigurator/WebWindowMaker.razor.cs b/WebWindowConfigurator/WebWindowMaker.razor.cs
index 1c06d12..30b00a6 100644
--- a/WebWindowConfigurator/WebWindowMaker.razor.cs
+++ b/WebWindowConfigurator/WebWindowMaker.razor.cs
@@ -15,26 +15,32 @@ namespace WebWindowConfigurator
#region Public Properties
[Parameter]
- public EventCallback
EC_OnClose { get; set; }
+ public string CssSvg { get; set; } = "responsive-svg";
[Parameter]
- public EventCallback EC_OnUpdate { get; set; }
+ public EventCallback EC_OnClose { get; set; }
[Parameter]
public EventCallback EC_OnSelectedTemplate { get; set; }
[Parameter]
- public List IN_TemplateDTOList { get; set; } = null!;
+ public EventCallback EC_OnUpdate { get; set; }
+
+ public List FillList
+ {
+ get => m_FillList;
+ }
[Parameter]
public Template IN_SelTemplate
{
get => m_SelTemplate;
- set {
+ set
+ {
if (value != null && (m_SelTemplate == null || (m_SelTemplate != null && value.nIndex != m_SelTemplate.nIndex)) && !string.IsNullOrEmpty(value.JWD))
{
m_SelTemplate = value;
- JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter());
+ JsonWindow WindowFromJson = JsonConvert.DeserializeObject(m_SelTemplate.JWD, new PolymorphicJsonConverter()) ?? new JsonWindow("");
m_CurrWindow = WindowFromJson.Deserialize();
m_FillList = new List();
m_SashList = new List();
@@ -45,98 +51,32 @@ namespace WebWindowConfigurator
}
}
+ [Parameter]
+ public List IN_TemplateDTOList { get; set; } = null!;
- private Template m_SelTemplate { get; set; } = null!;
-
- public TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
-
- public string m_SelSVG { get; set; } = "";
-
- #endregion Public Properties
-
- #region Protected Enums
-
- protected enum CompileStep
+ [Parameter]
+ public string LiveSVG
{
- Template = 0,
- Frame = 1,
- Split,
- Sash,
- Fill
+ get => m_SelSVG;
+ set => m_SelSVG = value;
}
- #endregion Protected Enums
-
- #region Protected Properties
-
- private Frame m_Frame;
- protected Frame Frame
- {
- get => m_Frame;
- set => m_Frame = value;
- }
-
- #endregion Protected Properties
-
- #region Protected Methods
- protected override void OnInitialized()
- {
- //base.OnInitialized();
- //m_CurrWindow = new Window();
- //Frame NewFrame = (Frame)Frame.CreateFrame(m_CurrWindow);
- //m_CurrWindow.AreaList.Add(NewFrame);
- //m_SelArea = NewFrame;
- //Sash NewSash = Sash.CreateSash(NewFrame);
- //NewFrame.AreaList.Add(NewSash);
- }
-
- protected async void DoSelect(TemplateSelectDTO newSel)
- {
- SelTemplateDTO = newSel;
- await EC_OnSelectedTemplate.InvokeAsync(newSel);
- }
- protected async Task DoSave()
- {
- var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
- await EC_OnUpdate.InvokeAsync(CurrJwd);
- }
- protected async Task DoClose()
- {
- await EC_OnClose.InvokeAsync(true);
- }
-
- #endregion Protected Methods
-
- #region Private Fields
-
- private CompileStep currStep = CompileStep.Template;
-
- #endregion Private Fields
-
- #region Private Properties
-
- private Window m_CurrWindow { get; set; } = new Window();
-
- #endregion Private Properties
-
- #region Private Methods
-
- private List m_SashList = new List();
public List SashList
{
get => m_SashList;
}
- private List m_FillList = new List();
- public List FillList
- {
- get => m_FillList;
- }
- private List m_SplitList = new List();
+
+ public TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
+
public List SplitList
{
get => m_SplitList;
}
+ #endregion Public Properties
+
+ #region Public Methods
+
public void SearchInAreaList(Area node)
{
if (node != null)
@@ -171,11 +111,122 @@ namespace WebWindowConfigurator
}
}
+ #endregion Public Methods
+
+ #region Protected Enums
+
+ protected enum CompileStep
+ {
+ Template = 0,
+ Frame = 1,
+ Split,
+ Sash,
+ Fill
+ }
+
+ #endregion Protected Enums
+
+ #region Protected Properties
+
+ protected Frame Frame
+ {
+ get => m_Frame;
+ set => m_Frame = value;
+ }
+
+ protected string m_SelSVG { get; set; } = "";
+
+ ///
+ /// Componente SVG da mostrare
+ ///
+ protected MarkupString outSvg
+ {
+ get
+ {
+ // aggiunta gestione classe svg per posizionamento con costraints
+ var newSvg = LiveSVG.Replace("