Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions 7.0/BlazorSample_Server/Shared/data-binding/NestedChild.razor
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<button @onclick="ChangeValue">Change from Child</button>
</p>

<NestedGrandchild @bind-GrandchildMessage="BoundValue" />
<NestedGrandchild @bind-GrandchildMessage:get="ChildMessage"
@bind-GrandchildMessage:set="ChildMessageChanged" />
</div>

@code {
Expand All @@ -17,12 +18,6 @@
[Parameter]
public EventCallback<string> ChildMessageChanged { get; set; }

private string BoundValue
{
get => ChildMessage ?? string.Empty;
set => ChildMessageChanged.InvokeAsync(value);
}

private async Task ChangeValue()
{
await ChildMessageChanged.InvokeAsync(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<button @onclick="ChangeValue">Change from Child</button>
</p>

<NestedGrandchild @bind-GrandchildMessage="BoundValue" />
<NestedGrandchild @bind-GrandchildMessage:get="ChildMessage"
@bind-GrandchildMessage:set="ChildMessageChanged" />
</div>

@code {
Expand All @@ -17,12 +18,6 @@
[Parameter]
public EventCallback<string> ChildMessageChanged { get; set; }

private string BoundValue
{
get => ChildMessage ?? string.Empty;
set => ChildMessageChanged.InvokeAsync(value);
}

private async Task ChangeValue()
{
await ChildMessageChanged.InvokeAsync(
Expand Down