【问题标题】:What's the difference between Name and x:Name?Name 和 x:Name 有什么区别?
【发布时间】:2011-08-19 08:23:38
【问题描述】:

在 Silverlight XAML 中,我可以给控件起这样的名称:

<Button Name="MyButton" />

或者像这样:

<Button x:Name="MyButton" />

那么,有什么区别呢?

【问题讨论】:

标签: silverlight xaml


【解决方案1】:
【解决方案2】:

这里是 an answer,作为对同一问题的回复(针对 WPF 提出的问题)发布的。

【讨论】:

  • 您指出的答案很有用,但指的是 WPF。在 Silveright 中没有 RuntimeNamePropertyAttributex:Name 仅映射到 Name(如果存在于 Silverlight 中)。
猜你喜欢
  • 2010-10-10
  • 1970-01-01
  • 1970-01-01
  • 2011-01-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多