In WPF, what are the differences between the x:Name and Name attributes?

前端 未结 15 1624
闹比i
闹比i 2020-11-22 05:19

The title says it all. Sometimes it seems that the Name and x:Name attributes are interchangeable.

So, what are the definitive differences

15条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-22 05:51

    x:Name means: create a field in the code behind to hold a reference to this object.

    Name means: set the name property of this object.

提交回复
热议问题