XAML is actually a flavor of XML , so in order to work with XAML , we need to follow its schema. Schema is like a agreement between both producer and consumer of XML , so they can work together. In case if you want to read that schema.
Whenever you create a new UWP Application in visual studio. You find some namespaces in the designer code of XAML. UWP stands for Universal Windows Platform. Go to solution explorer and Open MainPage.xaml. You'll find following lines of code in the tag of <page----></page> of your application. These are different schema and namespaces that uses in UWP applications. Now we're going to explore these namespaces one by one.

In the very first line you can find your class name which is infect your application name with MainPage. Below it you'll find few name spaces like
Whenever you create a new UWP Application in visual studio. You find some namespaces in the designer code of XAML. UWP stands for Universal Windows Platform. Go to solution explorer and Open MainPage.xaml. You'll find following lines of code in the tag of <page----></page> of your application. These are different schema and namespaces that uses in UWP applications. Now we're going to explore these namespaces one by one.
In the very first line you can find your class name which is infect your application name with MainPage. Below it you'll find few name spaces like
- :x
- :local
- :d
- :mc
- xmlns = " http:/schemas.microsoft.com/winfx/2006/xaml/presentation "
This schema defines all UI ( User Interface ) components like button , textblock etc. - xmlns : x = " http://schemas.microsoft.com/winfx/2006/xaml "
All of the rules of XAML in general are defined at this schema. From rules you can assume that rules which have to be followed while writing UI in XAML. - xmlns : local = " using: --- name of application --- "
This is a local namespace . You can reference your own local classes here by using this namespace in application. - xmlns : d = "http://schemas.microsoft.com/expression/blend/2008 "
- xmlns : mc = " http://schemas.openxmlformats.org/markup-compatibility/2006 "
xmlns : d and xmlns : mc are the schemas that used to represent the design view of application. Design view is the designer area of application. - mc : Ignorable = " d "
if you want to ignore some namespace on runtime , can put that namespace in double quotes as here " d " will be ignored on runtime that has been defined already on 4th line. This option exists here because of xmlns : mc namespace.
No comments:
Post a Comment