[Universal Apps] Structure structure and shared two

Understand the plan structure of Universal Apps and the two common aspects

??????? Universal Apps plan has three items by default (1) Windows Apps (2) Windows Phone Apps (3) Shared, as shown below

r1

??????? In these three projects Only Windows and Windows Phone projects will output binary files, but Shared projects will not output binary files, which means that Shared projects cannot be compiled independently, and it will not generate binary output files such as exe or dll.

?????? So how does Universal Apps compile, in fact, his compiling behavior is to merge all the files of the Windows and Shared projects first Together and then compile into a binary file of Windows Apps (in fact, you will get an exe file); the same is true for Windows Phone. When compiling all the files of Windows Phone and Shared project are merged before compiling, so three projects will get Two binary output files.

?????? After having a basic understanding of the structure of the program, let’s talk about’shared Two aspects’, when I created and modified the template in the template of the previous article [Universal Apps] Shared Basic Page, I kept thinking about’what is the meaning of sharing in Universal Apps?’. I found that sharing There are two aspects of meaning, you read it right, there are indeed two meanings, let me explain in detail.

???? ?? 1. Shared documents

?????? The meaning of sharing in Universal Apps is the easiest thing for everyone to understand is the shared document, that is, we create or Add some files, such as xaml, cs , Image files, text files, etc., so that the Windows project and Windows Phone project will refer to the same file to merge when compiling. This behavior is easy to understand, and most of it is the most intuitive way when it comes to sharing. Before me In an article template, MainPage.xaml belongs to this category.

?????? 2. Shared naming< /strong>

?????? The meaning of this sharing is not so intuitive, but I think it is also a way of sharing, this way is presented separately from Windows and Windows The Phone project creates files, but uses the same naming method, such as the same file name, the same full class name, and the same pattern (Style) key value, so that the program or xaml in the Shared can use the same naming to define two Entities belonging to different projects. In the template of my previous article, PageTitleControl.xaml and DefaultResources.xaml belong to the common naming type.

?????? So the matter of’sharing’ is not limited to the definition of shared files. When we deeply understand the two aspects of sharing, we will be able to apply this more flexibly in the Universal Apps solution. The two oriented skills are not only helpful for the speed of development, but also can give full play to its expertise in terms of platform characteristics.

Original: Large column [Universal Apps] Solution structure and shared two aspects< /p>

Leave a Comment

Your email address will not be published.