Note: Bo Master windows Phone Learning Novice, in the blog Park to share their just mastered some of the learning notes, simple content, master do not spray!
A while ago to see @ disappeared 3003 of the blog, found the TEXTBOXT header properties. This property can be useful for saving a lot of code when writing the UI.
Before writing a login interface as follows, the code will be very long;
UI and code that did not use the header property;
The code is as follows;
<Grid> <textblock text="Login"Fontsize=" -"margin="0,15,0,600"/> <textblock text="number/QQ"Fontsize=" -"margin="0,40,0,560"/> <textblock text="Account Number"Fontsize=" -"margin="20,105,0,500"/> <textbox text="number/Mobile number/QQ No."margin="20,130,50,450"/> <textblock text="Password"Fontsize=" -"margin="20,190,50,425"/> <textbox text="please fill in the password"margin="20,220,50,380"/> "Forgot your password? "Fontsize=" -"Foreground="Blue"margin="20,280,0,320"/> "Create a new account"Fontsize=" -"Foreground="Blue"margin="20,318,0,275"/> </Grid>
UI and code after using the header property;
The code is as follows
<grid > <textblock text="Login"Fontsize=" -"margin="0,15,0,600"/> <textblock text="number/QQ"Fontsize=" -"margin="0,40,0,560"/> <textbox header="Account Number"text="number/Mobile number/QQ No."margin="20,130,50,430"/> <textbox header="Password"text="please fill in the password"margin="20,220,50,350"/> "Forgot your password? "Fontsize=" -"Foreground="Blue"margin="20,280,0,320"/> "Create a new account"Fontsize=" -"Foreground="Blue"margin="20,318,0,275"/> </Grid>
By contrast, two lines of code are saved, and the advantage of the header property is greater in cases where the TextBox and TextBlock controls are more numerous.
Header properties for TextBox controls in Windows Phone development