Timur Mustafaev
Timur Mustafaev

Reputation: 4929

How set name to usercontrol in wpf

I've created UserControl and I don't know how to set Name property when I use it.

<my:LabelListBox Margin="12,314,480,12"/>

I need to access this control from my code. But without name, I don't know how.

Upvotes: 2

Views: 5364

Answers (1)

Jens
Jens

Reputation: 25593

Use

<my:LabelListBox x:Name="MyName" Margin="12,314,480,12"/>

Upvotes: 9

Related Questions