[Comprehensive unblocking! True expression blend practical development skills: Chapter 1 Best Practices in real development

Source: Internet
Author: User

From designers to developers
The designer creates an application.ProgramThen let developers implement the layout.

From developers to designers

The developer creates the function part of the application and the designer completes the style part.

Use standard naming

Standard naming can be addedCodeYou can obtain the name based on the purpose of creating the control. For example, tbcustomerid is a textblock used to display the customer ID; cnvtoolbox is a canvas wrapped in a button.

Use appropriate control types

Select the appropriate control based on the interface requirements. For example, a row of custom radiobutton and gird combinations are usually easier to use than tabcontrol, and the effect is cooler. You can easily define transition effects and animations.

Group controls (group or canvas) and name them

Do not name static sub-components. For example, a path used for shading and a background image does not make sense to name them. Divide related objects into a group and give the group a name.

Design and reuse of styles

Element styles should be consistent; resource dictionary reuse styles should be used between multiple applications; some core colors and brushes should be defined and converted to local resources, in this way, when we use them in the style, we can change the reference of all the resources with only one modification.

Benefits of using anonymous styles

By default, anonymous styles can be applied to all unspecified settings of the same type.

For example:

 
<StyleTargettype= "Button">

<Setter Property= "Background"Value= "Red"/>

</Style>

A style without the specified key attribute is called an anonymous style. If a button does not specify a style at this time, it applies the anonymous style by default and the background is red.

Exercise caution when selecting bitmap or loss graph (PATH)

Bitmap features: Large downloads, poor scaling, low resource occupation, and difficulty in code modification. You can use any bitmap tool to process bitmap, which requires pre-rendering before animation.

Vector Graphics features: The downloading volume is small, the size of the screen can be changed, the occupied resources are high, it is easy to modify the code, only used in XAML, you can use storyboard to change the vector graphics shape.

Behaviors)

Try to reuse styles

If possible, try to use an implicit style, which will save you a lot of repetitive code.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.