Skip to content

Commit 6784a01

Browse files
Copilotcsharpfritz
andcommitted
Update sample to demonstrate Sender property usage
Co-authored-by: csharpfritz <78577+csharpfritz@users.noreply.github.com>
1 parent f23da2e commit 6784a01

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • samples/AfterBlazorServerSide/Components/Pages/ControlSamples/Button

samples/AfterBlazorServerSide/Components/Pages/ControlSamples/Button/Index.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
void OnCommand(CommandEventArgs args) {
3131

3232
Console.WriteLine("Command fired");
33-
TheContent = $"Command '{args.CommandName}'";
33+
var button = (Button)args.Sender; // Access the sender!
34+
TheContent = $"Command '{args.CommandName}' from button with text '{button.Text}'";
3435

3536
}
3637

0 commit comments

Comments
 (0)