Skip to content

Commit becd6fa

Browse files
committed
2.0.1.4
1 parent 2e315ef commit becd6fa

5 files changed

Lines changed: 119 additions & 7 deletions

File tree

-90.2 KB
Binary file not shown.
90.6 KB
Binary file not shown.

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>net6.0</TargetFramework>
55
<SignAssembly>true</SignAssembly>
66
<AssemblyOriginatorKeyFile>Blazor.WebForm.Components.pfx</AssemblyOriginatorKeyFile>
7-
<Version>2.0.1.3</Version>
7+
<Version>2.0.1.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.6" />
20-
<PackageReference Include="Blazor.WebForm.UI" Version="2.0.1.3" />
21-
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.4" />
20+
<PackageReference Include="Blazor.WebForm.UI" Version="2.0.1.4" />
21+
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="6.0.5" />
2222
</ItemGroup>
2323

2424
<ItemGroup>

Blazor.WebForm.Components/PluralHolder.razor

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,7 @@
7878
{
7979
foreach (Extensions.Web.UI.WebControls.PluralHolder.PluralItem item in this.Control.Items)
8080
{
81-
if (item.DataItem == null || item.DataItem == item.DataItem)
82-
{
83-
item.DataItem = this.DataItem;
84-
}
81+
item.DataItem = this.DataItem;
8582
}
8683
}
8784
}
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
@using Blazor.WebForm.UI
2+
@using Blazor.WebForm.UI.ControlComponents
3+
@using System.Web.UI
4+
@using System.Web.UI.WebControls
5+
@inherits WebControlComponent<System.Web.UI.WebControls.RichTextBox>
6+
@this.RenderWithInner(this.Control)
7+
@code {
8+
[Parameter]
9+
public RenderFragment ChildContent { get; set; }
10+
11+
[Parameter]
12+
public string ValidationGroup
13+
{
14+
get
15+
{
16+
return this.Control.ValidationGroup;
17+
}
18+
set
19+
{
20+
this.Control.ValidationGroup = value;
21+
}
22+
}
23+
24+
[Parameter]
25+
public bool CausesValidation
26+
{
27+
get
28+
{
29+
return this.Control.CausesValidation;
30+
}
31+
set
32+
{
33+
this.Control.CausesValidation = value;
34+
}
35+
}
36+
37+
[Parameter]
38+
public bool AutoPostBack
39+
{
40+
get
41+
{
42+
return this.Control.AutoPostBack;
43+
}
44+
set
45+
{
46+
this.Control.AutoPostBack = value;
47+
}
48+
}
49+
50+
[Parameter]
51+
public string InnerHtml
52+
{
53+
get
54+
{
55+
return this.Control.InnerHtml;
56+
}
57+
set
58+
{
59+
this.Control.InnerHtml = value;
60+
}
61+
}
62+
63+
[Parameter]
64+
public HtmlTextWriterTag TextBoxTag
65+
{
66+
get
67+
{
68+
return this.Control.TextBoxTag;
69+
}
70+
set
71+
{
72+
this.Control.TextBoxTag = value;
73+
}
74+
}
75+
76+
[Parameter]
77+
public EventHandler OnTextChanged
78+
{
79+
get
80+
{
81+
return this.GetEventProperty();
82+
}
83+
set
84+
{
85+
this.SetEventProperty(value, i => this.Control.TextChanged += i, i => this.Control.TextChanged -= i);
86+
}
87+
}
88+
89+
protected override void OnInitialized()
90+
{
91+
base.OnInitialized();
92+
if (this.HasPropertyBindEvent<string>(nameof(this.InnerHtml)))
93+
{
94+
this.Control.AutoPostBack = true;
95+
this.Control.TextChanged += this.BindInnerHtmlChanged;
96+
if (this.HasEventProperty(nameof(this.OnTextChanged)))
97+
{
98+
this.SetBindEventProperty(nameof(this.OnTextChanged), this.BindInnerHtmlChanged);
99+
}
100+
}
101+
}
102+
103+
private void BindInnerHtmlChanged(object sender, EventArgs e)
104+
{
105+
this.InvokePropertyBindEvent(nameof(this.InnerHtml), this.InnerHtml);
106+
}
107+
108+
protected override void SetInnerPropertyWithInner(IReadOnlyDictionary<string, object> parameters)
109+
{
110+
if (parameters.ContainsKey(nameof(this.ChildContent)) && this.ChildContent != null)
111+
{
112+
this.InnerHtml = RenderUtility.GetContentString(this.ChildContent);
113+
}
114+
}
115+
}

0 commit comments

Comments
 (0)