Tags: text lock back present texts grid repeat gradient SEM
Movable type printing is one of China's "four big Inventions", after the invention of movable type, he quickly found a problem, with the increasing number of printed materials, to use more and more Chinese characters, so he must find an effective way to manage those carved with Chinese characters of the cube (called the cube, Actually is a cube), so, he and the assistants work together, for these cubes to record, marked to put, in the printing process to use what words, directly take out, no need to put back, both environmentally friendly and convenient.
This is the resources, water, air, sunlight is also a resource, coal, iron mineral is also a resource, but some renewable, some non-renewable.
What is a resource? Resources are objective, when we need to take advantage of all the things that can be controlled or re-assembled, such as human resources, network resources and so on.
If you have done a Web page, you should understand what CSS is used to do, in fact, the resources we are discussing today, and the concept of CSS style sheet basically the same, is to save some of the frequently used things, can be repeated in the application of the call, so that we do not have to set the style for each control, We can save the style to a list of resources and use it to remove it without repeating the definition.
Here's a look at this XAML, there are 4 TextBlock, I now want each TextBlock font size is 37.5, of course, simple values can be easily set, if the value is very complex, such as the previous article said the template, then you are very painful, to make a template for each control.
How do you do it? Because the font size is a double type, you first introduce namespaces. How do you do it? Because the font size is a double type, you first introduce namespaces.
Next, define a font size resource in the page resource collection, note that to set the key, each resource has a unique key, and the application uses this key to find the corresponding resource. Next, define a font size resource in the page resource collection, note that to set the key, each resource has a unique key, and the application uses this key to find the corresponding resource.
The reference to the resource is simple, put in a pair of curly braces (extended markup), StaticResource is a static resource, note that only static resources in Silverlight, if WPF, and dynamic resources, the space is behind the resource key, do not ask me why.
Another example, there are three buttons, I hope they all have a gradient background color, horizontal left alignment, vertical top alignment, Width 185, height 50.
Now I just declare a style in the resource collection and apply it to each button.
Windows Phone Development (15): Resources