What is difference between ‘Name’ and ‘x:Name’ in Xaml ?

When working with a control in Xaml (WPF/Silverlight/Windows Phone /Windows Store App) , you will notice that for a control , there are 2 options to specify the name for the control . One using “Name” property and other using “x:Name” property.

What is difference between ‘Name’ and ‘x:Name’ in Xaml ?

Both the properties refer to the same item . We generally use x:Name when defining a UserControl.

The Name property can be used only for descendants of FrameworkElement and FrameworkContentElement where as x:Name can be used for all the Xaml elements

Tags :

Leave Your Comment

Liked this content?. Please spread the word :)