Reputation: 15302
Normally when you want to associate a Wpf Label with a target element you'd do the following:
<Label Target="{Binding ElementName=FirstName}" Content="First Name:" />
<TextBlock Name="FirstName" ... />
I was wondering if there is any other way to do this without using a Name
or x:Name
property?
Upvotes: 2
Views: 211
Reputation: 564481
Using a named control and an ElementName
binding is the standard approach to setting a label target.
The other approach would be to specifically set the Target
property to a UIElement
, which could be done in code behind for a generated UI, for example.
Upvotes: 2