wpf-Notes <2015.02.10>

Source: Internet
Author: User

Default WPF template Analysis:

Properties: Mainly the application of some resources and configuration information;

References: Mark which other items the project needs to refer to currently;

App.xaml: The body of the program. In a Windows system, a program is a process. WINDOWG also stipulates that a GUI process needs to have a form as the "main form". The role of the App.xaml file is to declare the process and main form of the program;

Window1.xaml: The main form of the program, whose background code is Window1.xaml.cs.

XAML is derived from XML, using tags to declare an element (each of which corresponds to an object in memory), using the start tag <Tag> and terminating tag </tag>, and the XAML code in the middle that represents the content that belongs to the tag. If nothing is attached to this tag, the label is called an empty label and can be written as <Tag/>. To indicate that a label in a similar label is different, assign a value to its feature (Attribute), and the syntax for assigning a feature is as follows:

1), non-empty tags: <tag attribute1=value1, attribute2=value2> Content </Tag>

2), Empty tags: <tag attribute1=value1, attribute2=value2/>

Property and Attribute differences:

Property belongs to object-oriented theory category, it is to object, attribute is the grammatical level of programming language, it is only related to the language level, it has nothing to do with abstract object.

XAML is a "declarative" language, and a label means declaring an object in which the hierarchical relationship between objects is either side-by-side or contained, all in the label's evil relationship.

xmlns is the abbreviation for Xml-namespace, with the following syntax:

xmlns[: Optional mapping prefix] = "namespace"

The mapping prefix is optional and, if not, all tags from the namespace are not prefixed, the namespace becomes the "default namespace", only one of the default namespaces, and should be chosen as the most frequently used namespace for the element. The namespace is just a hard code for the XAML compiler (hard-coding), and as soon as you see the fixed string, you will include a set of necessary assemblies (Assembly) and assemblies. NET namespace reference in.

The xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation namespace is a representation of something on the (presentation) level;

xmlns:x= The http://schemas.microsoft.com/winfx/2006/xaml namespace corresponds to the assembly associated with XAML language resolution processing, which is something at the language level. x:class the role of this attribute when the XAML parser parses the label containing it into a C # class, what is the class name of the class. The partial mechanism is used in the UI layer and behind the scenes.


This article from "Ink Pool small" blog, declined reprint!

wpf-notes <2015.02.10> in layman's note;

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.