Skip to content

Commit

Permalink
chore: Fix minor error
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklimakc committed May 9, 2024
1 parent 327e4cb commit 3f5ce51
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/Learn/Markup/Appendix/AccessingControlInstance.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ uid: Uno.Extensions.Markup.Appendix.AccessingControlInstance

There are a number of times when you may find yourself wanting to access the instance of a control that you initialized. This could be useful for bindings or even to later configure Event Handlers on the control. You can most easily do this with the `Name` method as follows:

```cs
```csharp
this.Content(
new StackPanel()
.Children(
Expand All @@ -24,7 +24,7 @@ button.Click += delegate {

You can also define a CallBack using the `Name` method:

```cs
```csharp
int i = 1;

this.Content(
Expand All @@ -33,9 +33,9 @@ this.Content(
new Button()
.Name(button =>
{
b.Click += (s, e) =>
button.Click += (s, e) =>
{
b.Content = $"Clicked {i++} times";
button.Content = $"Clicked {i++} times";
};
})
.Content("Press Me")
Expand All @@ -45,7 +45,7 @@ this.Content(

Or if you want to expose a variable and also define a CallBack:

```cs
```csharp
int i = 1;

this.Content(
Expand Down

0 comments on commit 3f5ce51

Please sign in to comment.