The concept of "attribute elements" in this section can be described in an incredible way.
1. WPF uses tag elements to implement object modeling. There are two types: Control and container, which are used to load content and behavior. The former is like button, and the latter is like window.
You can write as follows:
< Window >
< Button width = " 100 " Height = " 100 " >
< Image Source = " Tom.png " />
</ Button >
</ Window >
You can also do this: < Window >
< Button width = " 100 " Height = " 100 " >
< Textbox width = " 75 " > Edit me </ Textbox >
</ Button >
</ Window >
That is to say, the image and textbox attributes of the original button are extracted as objects. This is because the button originated from a class: contentcontrol, which knows how to generate all the controls it loads.
2. The complete statement is as follows: < Button width = " 100 " Height = " 100 " >
< Button. Content >
< Image Source = " Tom.png " />
</ Button. Content >
</ Button >
However, the <button. content> label cannot contain two controls, and a syntax error is displayed. It can only be one attribute element-panel is used at this time.
The window control has the same usage as the button. See the following section.