From 23a2e2b6f4ed31f6e58f2ae176ab98b032e26eb8 Mon Sep 17 00:00:00 2001 From: IX-BOT <137874481+IX-BOT@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:59:08 +0200 Subject: [PATCH] [BUG] shadows are not updated on onliners change (#315) * Create draft PR for #314 * Shadow base overide onliner property --------- Co-authored-by: blazej.kuhajda --- .../Base/Shadow/TemplateBaseShadow.cs | 20 +++++++++++++++++-- .../Templates/TemplateBase.razor.cs | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/Base/Shadow/TemplateBaseShadow.cs b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/Base/Shadow/TemplateBaseShadow.cs index b2a03fe7..6f74ff8e 100644 --- a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/Base/Shadow/TemplateBaseShadow.cs +++ b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/Base/Shadow/TemplateBaseShadow.cs @@ -10,10 +10,26 @@ namespace AXSharp.Presentation.Blazor.Controls.Templates { public partial class TemplateBaseShadow : TemplateBase { + private OnlinerBase _Onliner; + + [Parameter] + public override OnlinerBase Onliner + { + get { return _Onliner; } + set + { + if (_Onliner != value) + { + _Onliner = value; + UpdateShadowValuesOnChange(_Onliner); + } + } + } + protected override Task OnInitializedAsync() { - UpdateShadowValuesOnChange(Onliner); + // UpdateShadowValuesOnChange(Onliner); return base.OnInitializedAsync(); } } -} +} \ No newline at end of file diff --git a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/TemplateBase.razor.cs b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/TemplateBase.razor.cs index 6d49a2d9..ddfa76fe 100644 --- a/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/TemplateBase.razor.cs +++ b/src/AXSharp.blazor/src/AXSharp.Presentation.Blazor.Controls/Templates/TemplateBase.razor.cs @@ -25,7 +25,7 @@ public IJSRuntime JSRuntime protected string ToolTipText => Onliner?.HumanReadable; [Parameter] - public OnlinerBase Onliner { get; set; } + public virtual OnlinerBase Onliner { get; set; } [Parameter] public bool IsReadOnly { get; set; } @@ -59,7 +59,7 @@ protected T Value protected override Task OnInitializedAsync() { AccessStatus = Onliner.AccessStatus.Failure ? "is-invalid" : ""; - ComponentId = Onliner.GetSymbolTail() + "_" + Guid.NewGuid().ToString(); + ComponentId = Onliner.Symbol + "_" + Guid.NewGuid().ToString(); return base.OnInitializedAsync(); } }