Skip to content

Commit be99172

Browse files
committed
2.5.0.4
1 parent 9b41521 commit be99172

12 files changed

Lines changed: 310 additions & 5 deletions
-98.4 KB
Binary file not shown.
99.7 KB
Binary file not shown.

Blazor.WebForm.Components/Base/ControlComponentBase.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public abstract class ControlComponentBase<TControl> : ControlComponent<TControl
2626
private IReadOnlyDictionary<string, object> _parameters;
2727
private bool _renderedWithCascading;
2828
private bool _renderedWithInner;
29+
private bool _captureReference;
2930
private TemplateControl _templateControl;
3031

3132
//new public virtual TControl Control
@@ -321,7 +322,8 @@ protected override Task OnSetParametersAsync(ParameterViewContext context)
321322
if (control != null)
322323
{
323324
this.Control = control;
324-
if (control.IsPostBack)
325+
_captureReference = true;
326+
if (control.IsPostBack || (control as IHandleSetInner).Rendered)
325327
{
326328
filter = true;
327329
_renderedWithCascading = true;
@@ -353,6 +355,15 @@ protected override void OnAfterRender(bool firstRender)
353355
base.OnAfterRender(firstRender);
354356
}
355357

358+
protected override RenderFragment Render<TValue>(TValue control)
359+
{
360+
if (_captureReference)
361+
{
362+
(control as IHandleSetInner).Rendered = true;
363+
}
364+
return base.Render(control);
365+
}
366+
356367
protected virtual void SetInnerPropertyWithCascading(IReadOnlyDictionary<string, object> parameters)
357368
{
358369

Blazor.WebForm.Components/Blazor.WebForm.Components.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFramework>net9.0</TargetFramework>
55
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>Blazor.WebForm.Components.pfx</AssemblyOriginatorKeyFile>
7-
<Version>2.5.0.3</Version>
7+
<Version>2.5.0.4</Version>
88
<RootNamespace>asp</RootNamespace>
99
<Copyright>Jurio li</Copyright>
1010
<AssemblyName>Blazor.WebForm.Components</AssemblyName>
@@ -17,8 +17,8 @@
1717

1818
<ItemGroup>
1919
<PackageReference Include="Applied" Version="1.2.1.8" />
20-
<PackageReference Include="Blazor.WebForm.UI" Version="2.5.0.3" />
21-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.2" />
20+
<PackageReference Include="Blazor.WebForm.UI" Version="2.5.0.4" />
21+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.3" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

Blazor.WebForm.Components/GridView.razor

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,19 @@
467467
}
468468
}
469469

470+
[Parameter]
471+
public bool AllowVirtualizing
472+
{
473+
get
474+
{
475+
return this.Control.AllowVirtualizing;
476+
}
477+
set
478+
{
479+
this.Control.AllowVirtualizing = value;
480+
}
481+
}
482+
470483
protected override void SetInnerPropertyWithCascading(IReadOnlyDictionary<string, object> parameters)
471484
{
472485
if (parameters.TryGetValue(nameof(this.EditIndex), out object value1) && value1 is int editIndex)

Blazor.WebForm.Components/Inner/Base/PropertyComponentAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ protected internal virtual void SetInnerProperty(IReadOnlyDictionary<string, obj
2929

3030
protected internal virtual void SetInnerPropertyWithCascading(IReadOnlyDictionary<string, object> parameters)
3131
{
32-
this.Component.SetInnerProperty(parameters);
32+
this.Component.SetInnerPropertyWithCascading(parameters);
3333
}
3434

3535
protected internal virtual void OnAfterRender()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
using Blazor.WebForm.UI.PropertyComponents;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace Microsoft.AspNetCore.Components
9+
{
10+
public partial class VirtualizerSettings : PropertyComponent<System.Web.UI.WebControls.DataBoundControl>, ICommonPropertyComponent
11+
{
12+
[Parameter]
13+
public string SpacerElement { get; set; }
14+
15+
[Parameter]
16+
public float? ItemSize { get; set; }
17+
18+
[Parameter]
19+
public int? OverscanCount { get; set; }
20+
21+
[Parameter]
22+
public int? MaxItemCount { get; set; }
23+
}
24+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Blazor.WebForm.UI.PropertyComponents;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace Microsoft.AspNetCore.Components
9+
{
10+
[CommonPropertyAdapter(typeof(System.Web.UI.WebControls.GridView), typeof(GridViewVirtualizerSettings))]
11+
public partial class VirtualizerSettings
12+
{
13+
protected class GridViewVirtualizerSettings : PropertyComponentAdapter<VirtualizerSettings, System.Web.UI.WebControls.GridView>
14+
{
15+
protected internal override void SetInnerProperty(IReadOnlyDictionary<string, object> parameters)
16+
{
17+
this.Owner.VirtualizerSettings.Apply(() => parameters);
18+
}
19+
}
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Blazor.WebForm.UI.PropertyComponents;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
8+
namespace Microsoft.AspNetCore.Components
9+
{
10+
[CommonPropertyAdapter(typeof(System.Web.UI.WebControls.ListView), typeof(ListViewVirtualizerSettings))]
11+
public partial class VirtualizerSettings
12+
{
13+
protected class ListViewVirtualizerSettings : PropertyComponentAdapter<VirtualizerSettings, System.Web.UI.WebControls.ListView>
14+
{
15+
protected internal override void SetInnerProperty(IReadOnlyDictionary<string, object> parameters)
16+
{
17+
this.Owner.VirtualizerSettings.Apply(() => parameters);
18+
}
19+
}
20+
}
21+
}

Blazor.WebForm.Components/ListView.razor

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,19 @@
201201
}
202202
}
203203

204+
[Parameter]
205+
public bool AllowVirtualizing
206+
{
207+
get
208+
{
209+
return this.Control.AllowVirtualizing;
210+
}
211+
set
212+
{
213+
this.Control.AllowVirtualizing = value;
214+
}
215+
}
216+
204217
protected override void SetInnerPropertyWithCascading(IReadOnlyDictionary<string, object> parameters)
205218
{
206219
if (parameters.TryGetValue(nameof(this.EditIndex), out object value1) && value1 is int editIndex)

0 commit comments

Comments
 (0)