4

In Silverlight XAML, I can give a control a name like this:

<Button Name="MyButton" />

or like this:

<Button x:Name="MyButton" />

So, what's the difference?

Montgomery 'monty' Jones
  • 1,061
  • 2
  • 14
  • 27
  • same question has been asked before: http://stackoverflow.com/questions/589874/in-wpf-what-are-the-differences-between-the-xname-and-name-attributes – toolsche Aug 19 '11 at 09:10
  • @Toolsche: Its not quite the same, that question is in the WPF context. – AnthonyWJones Aug 19 '11 at 11:27

2 Answers2

1

Take a look to Is there any difference in x:name and name for controls in xaml file? post.

Community
  • 1
  • 1
Samvel Siradeghyan
  • 3,523
  • 3
  • 30
  • 49
0

Here is an answer, as posted in response to the same question (asked in relation to WPF).

Community
  • 1
  • 1
Montgomery 'monty' Jones
  • 1,061
  • 2
  • 14
  • 27
  • That answer you point is useful but refers to WPF. In Silveright there is no `RuntimeNamePropertyAttribute`, `x:Name` is only mapped to `Name` if present in Silverlight. – AnthonyWJones Aug 19 '11 at 11:25