Fix riduzione catena chiamate multiple
Fix loop update parent-child control
This commit is contained in:
@@ -587,11 +587,21 @@ namespace WebWindowComplex
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
{
|
||||
#if DEBUG
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented);
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
|
||||
Args.Add("Jwd", CurrJwd);
|
||||
await EC_OnUpdate.InvokeAsync(Args);
|
||||
#else
|
||||
var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize());
|
||||
#endif
|
||||
// verifico variazione JWD
|
||||
if (!prevJwd.Equals(CurrJwd))
|
||||
//if (!prevJwd.Equals(LiveData.CurrJwd) || !prevJwd.Equals(CurrJwd))
|
||||
{
|
||||
prevJwd = CurrJwd;
|
||||
Dictionary<string, string> Args = new Dictionary<string, string>();
|
||||
Args.Add("Mode", $"{(int)Enums.QuestionModes.PREVIEW}");
|
||||
Args.Add("Jwd", CurrJwd);
|
||||
await EC_OnUpdate.InvokeAsync(Args);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -641,16 +651,11 @@ namespace WebWindowComplex
|
||||
await EC_OnSelectedTemplate.InvokeAsync(newSel);
|
||||
}
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gestione update post ricezione parametri da controllo chiamante
|
||||
/// </summary>
|
||||
protected override void OnParametersSet()
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
// controllo elenchi BasePayload siano validi...
|
||||
if (ListPayload.IsValid())
|
||||
@@ -681,9 +686,16 @@ namespace WebWindowComplex
|
||||
}
|
||||
if (SashList.Count > 0)
|
||||
currAnta = 0;
|
||||
|
||||
await DoPreviewSvg();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Salvataggio JWD precedente x evitare loop su update
|
||||
/// </summary>
|
||||
private string prevJwd { get; set; } = "";
|
||||
|
||||
protected void setCurrWindow(JsonWindow WindowFromJson)
|
||||
{
|
||||
if (m_CurrWindow != null)
|
||||
|
||||
Reference in New Issue
Block a user