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

This content was proof-read by Grammarly. You can Try Grammary for FREE

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.

Are you a .NET Developer planning to integrate GraphQL for .NET in your Application? Check out this book BUY & DOWNLOAD GRAPHQL.NET COOKBOOK

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

%d bloggers like this: