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

前端 未结 15 1546
闹比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:40

    X:Name can cause memory issues if you have custom controls. It will keep a memory location for the NameScope entry.

    I say never use x:Name unless you have to.

提交回复
热议问题