XAML has a set of rules for ing XAML object elements to classes or struct, element attributes to class attributes or events, and ing XML Namespaces to CLR namespaces, the XAML element is mapped to the referenced. type defined in the. NET program set, and element attributes are mapped to these type member attributes.
In the "declarative language supported by Flow Control" section, two object elements are specified: <stackpanel> and <button>. The stackpanel and button strings are mapped to the classes with the same names defined in the WPF program respectively. When specifying an object element tag, you must create an instruction for the XAML processing, when the XAML page is loaded, use this command to create a new instance of this naming class. Each instance is created by calling the default constructor of a class or struct. If an element in XAML can be used as a class object, this class or struct must expose a public default constructor (without any parameters ).