Skip to content

Commit

Permalink
chore: Add note about Name usage
Browse files Browse the repository at this point in the history
  • Loading branch information
eriklimakc committed Mar 8, 2024
1 parent 071fb9d commit 95a8a95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/Learn/Markup/DependencyPropertyBuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ new TextBlock()
.Binding(() => slider.Value))
```

> [!NOTE]
> Using the `.Name(out var fe)` syntax not only gives you a variable representing your `FrameworkElement` control but also sets the control's `Name` property to match the variable name. For example, in the scenario mentioned earlier, the `Slider` would have its `Name` property set to "slider" because the variable name used is `slider`.

The second is that we can leverage the element name for our binding such as the following:

```cs
Expand Down

0 comments on commit 95a8a95

Please sign in to comment.