Below are two important c# WPF xmlns interview questions which are asked frequently in WPF interviews. These questions are provided by questpond.com site a great thanks to them.
What is xmlns in XML ?
“xmlns” stands for XML namespaces. It helps us to avoid name conflicts and confusion in XML documents. For example consider the below two XML which have table elements, one table is a HTML table and the other represents a restaurant table. Now if both these elements come in a single XML document there would name conflicts and confusion.
So to avoid the same we can use XML namespaces. You can see in the below XML we have qualified the HTML table with “<h:table>” and the restaurant table element qualified with “<r:table>”.
What is the difference between xmlns and xmlns:x in WPF ?
Bothe namespaces helps to define / resolved XAML UI elements.
The first namespace is the default namespace and helps to resolve overall WPF elements.
The second namespace is prefixed by “x:” and helps to resolve XAML language definition.
For instance for the below XAML snippet , we have two things one is the “StackPanel” and the other is “x:name”. “StackPanel” is resolved by the default namespace and the “x:name” is resolved by using “xmlns:x” namespace.
Below video explain what is WPF and how they differ from Windows form