Update componente con CurrJwd (NON gestito)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Version>2.7.8.809</Version>
|
||||
<Version>2.7.8.812</Version>
|
||||
<Authors>Annamaria Sassi</Authors>
|
||||
<Company>Egalware</Company>
|
||||
<Description>Componente gestione JWD per LUX</Description>
|
||||
@@ -42,3 +42,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,20 +12,18 @@ namespace WebWindowConfigurator
|
||||
{
|
||||
public partial class WebWindowMaker : IDisposable
|
||||
{
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
#region Public Properties
|
||||
|
||||
[Parameter]
|
||||
public string CssSvg { get; set; } = "responsive-svg";
|
||||
|
||||
[Parameter]
|
||||
public string CurrJwd
|
||||
{
|
||||
get => m_CurrJwd;
|
||||
set => m_CurrJwd = value;
|
||||
}
|
||||
|
||||
[Parameter]
|
||||
public EventCallback<bool> EC_OnClose { get; set; }
|
||||
|
||||
@@ -83,23 +81,105 @@ namespace WebWindowConfigurator
|
||||
set => m_SelSVG = value;
|
||||
}
|
||||
|
||||
public List<Sash> SashList
|
||||
{
|
||||
get => m_SashList;
|
||||
}
|
||||
|
||||
public TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
|
||||
|
||||
public List<Split> SplitList
|
||||
{
|
||||
get => m_SplitList;
|
||||
}
|
||||
|
||||
#endregion Public Properties
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void SearchInAreaList(Area node)
|
||||
public void Dispose()
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview;
|
||||
m_CurrWindow = null;
|
||||
}
|
||||
}
|
||||
|
||||
#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_CurrJwd { get; set; } = "";
|
||||
|
||||
protected string m_SelSVG { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Componente SVG da mostrare
|
||||
/// </summary>
|
||||
protected MarkupString outSvg
|
||||
{
|
||||
get
|
||||
{
|
||||
// aggiunta gestione classe svg per posizionamento con costraints
|
||||
var newSvg = LiveSVG.Replace("<svg", $"<svg class=\"{CssSvg}\"");
|
||||
return (MarkupString)newSvg;
|
||||
}
|
||||
}
|
||||
|
||||
protected List<Sash> SashList
|
||||
{
|
||||
get => m_SashList;
|
||||
}
|
||||
|
||||
protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null;
|
||||
|
||||
protected List<Split> SplitList
|
||||
{
|
||||
get => m_SplitList;
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task DoClose()
|
||||
{
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
protected async Task DoPreviewSvg()
|
||||
{
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
await EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
}
|
||||
|
||||
protected async Task DoSave()
|
||||
{
|
||||
//manca salvataggio JWD
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
protected async void DoSelect(TemplateSelectDTO newSel)
|
||||
{
|
||||
SelTemplateDTO = newSel;
|
||||
await EC_OnSelectedTemplate.InvokeAsync(newSel);
|
||||
}
|
||||
|
||||
protected async void DoSelectAndPreview(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
protected void SearchInAreaList(Area node)
|
||||
{
|
||||
if (node != null)
|
||||
{
|
||||
@@ -133,97 +213,17 @@ 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; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Componente SVG da mostrare
|
||||
/// </summary>
|
||||
protected MarkupString outSvg
|
||||
{
|
||||
get
|
||||
{
|
||||
// aggiunta gestione classe svg per posizionamento con costraints
|
||||
var newSvg = LiveSVG.Replace("<svg", $"<svg class=\"{CssSvg}\"");
|
||||
return (MarkupString)newSvg;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Protected Properties
|
||||
|
||||
#region Protected Methods
|
||||
|
||||
protected async Task DoSave()
|
||||
{
|
||||
//manca salvataggio JWD
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
|
||||
protected async Task DoClose()
|
||||
{
|
||||
await EC_OnClose.InvokeAsync(true);
|
||||
}
|
||||
#endregion Protected Methods
|
||||
|
||||
#if false
|
||||
protected void DoUpdatePreview(object sender, OnPreviewEventArgs e)
|
||||
{
|
||||
EC_OnUpdate.InvokeAsync(e.sJwd);
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
}
|
||||
#endif
|
||||
|
||||
protected async Task DoPreviewSvg()
|
||||
{
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
await EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
}
|
||||
|
||||
protected async void DoSelect(TemplateSelectDTO newSel)
|
||||
{
|
||||
SelTemplateDTO = newSel;
|
||||
await EC_OnSelectedTemplate.InvokeAsync(newSel);
|
||||
}
|
||||
|
||||
private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e)
|
||||
{
|
||||
EC_OnUpdate.InvokeAsync(e.sJwd);
|
||||
#if false
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
#endif
|
||||
}
|
||||
|
||||
protected async void DoSelectAndPreview(CompileStep newStep)
|
||||
{
|
||||
currStep = newStep;
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Fields
|
||||
|
||||
private CompileStep currStep = CompileStep.Template;
|
||||
@@ -241,10 +241,10 @@ namespace WebWindowConfigurator
|
||||
#region Private Properties
|
||||
|
||||
private Window? m_CurrWindow { get; set; } = null;
|
||||
//private Window m_CurrWindow { get; set; } = new Window();
|
||||
|
||||
private Template m_SelTemplate { get; set; } = null!;
|
||||
|
||||
//private Window m_CurrWindow { get; set; } = new Window();
|
||||
private string mainCss
|
||||
{
|
||||
get => (SelTemplateDTO != null && currStep != CompileStep.Template) ? "col-6" : "col-12";
|
||||
@@ -259,6 +259,15 @@ namespace WebWindowConfigurator
|
||||
currStep = newStep;
|
||||
}
|
||||
|
||||
private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e)
|
||||
{
|
||||
EC_OnUpdate.InvokeAsync(e.sJwd);
|
||||
#if false
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
EC_OnUpdate.InvokeAsync(CurrJwd);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calcola il css del tab selezionato
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user