UWP introductory tutorial 1
The UI and general input mode
; Common controls and layout panel
; Adaptive extended
; General input processing
In this article, can grasp the following knowledge:
; Equipment, how to decide the destination
; The new UI controls and help you adapt to the new panel equipment characteristics of the different
Since Windows 8 system, Microsoft introduced WindowsRT (Windows Runtime), it is an intermediate stage of Windows App model.Hope to be able to become a general application architecture.
When Windows Phone 8.1 release, also compatible WRT.This helps developers to use the same code base to create generic Windows app.
After nearly three years,start Microsoft Windows 10 finally was born.Windows 10 UWP begin to introduce, further development of the Windows RunTime model, and to the introduction of the WRT the Windows 10 kernel.As part of the system kernel, UWP now provide create generic App platform (that is, the App can run in all the equipment running Windows 10), and, of course, Microsoft also has made the improvement, UWP not only contains the WinRT API, also increased to adapt to the specific equipment group of API.UWP App for development across devices provide reliable API layer.This means that you only need to develop a, can be run in a variety of equipment.And published to the Windows Store, all users can download the trial.
Regardless of the device and the input mode is different, the form of UWP can run, can also be customized for special equipment.Adaptive UI control Panel and a new layout helps to solve the diversity of device screen sizes.
Windows8.1 and Windows Phone 8.1 App there are differences of the operating system, whether it's Windows and Windows Phone.With 10 Windows don't need to the development of all energy is concentrated in the operating system, but need to address one or more equipment characteristics.Equipment group can identify the API, the system characteristics, and user behavior, also decided to run an App set of equipment.
Equipment group is a collection of API set with the version number and identifier, equipment group is the basis of the OS, PC desktop operating system, is determined
according to the desktop device groups, smart phones and tablets will run Mobile OS, is determined by the Mobile population, and so on.
General population relatively special equipment, it is not the basis for any OS, on the contrary, universal equipment group apis are all ethnic group's parent, is because of the universal equipment ethnic API each OS to ensure the normal present in each device.
Each device groups based on the general population to add their own API.Is to develop the advantages of using equipment group once, run anywhere, regardless of what kind of equipment, they are using mobile phone, tablet or PC.App can use adaptive code to implement dynamic access device characteristics, to adapt to the equipment.
Your App needs to use which kinds of equipment, mainly depends on the development needs, and decided to affect the final rendering App:
1. The API set, App needs to call at runtime API
2. The API set calls
3. To adapt to the set of equipment, the App can be installed equipment types.
Select equipment group is mainly decided by two aspects reasons, API interface type, is to create the App can call unconditionally, and App scope of equipment need to cover.
How to make decisions:
; To maximize the App cover
; In order to realize the maximization of the App covering equipment to ensure that it can run in the
equipment as much as possible, can put the App targeting general equipment.The aim, the App can
use all the equipment group, (groups derived from general equipment)
; Limit the App to adapt to a certain device
; Limit App to one type of equipment
; Exclude only support a particular version of the equipment
The UI and general input
UWP App can run in the devices with different characteristics.Windows 10 provide new common controls, layout panel and tools, to help develop adaptive UI.According to the different screen resolution, for example, the corresponding UI adjustment.
Windows help you to realize adaptive UI:
1. Provide common controls and layout panel to according to the screen resolution to optimize the user interface (UI)
2. The commonly used input processing, can solve the problem of input mode diversity, whether by touch input, stylus, keyboard, or the controller, can be unified handling.
3. Provide the UI design tools, adaptive to different screen resolutions.
4. Adaptive extended resolution and DPI can be adjusted.
General control and board layout
Windows 10 provides some new control, such as calendar, split views, before that, only the Winodws Phone provides the Pivot control, now, general equipment group also supports the Pivot control.And controls also made the corresponding adjustment, can adapt to the large size screen.
Using adaptive interface to realize adaptive Panels
Layout Panel to specify the size of the child element value mainly depends on the screen size and location, such as the StackPanel will specify the child nodes order (vertical or horizontal).The Grid with CSS, similar to the Grid each interface elements corresponding cell.
New offer RelativePanel is a kind of layout style, can define the relationship between the surface elements from all walks of life, when the screen resolution changes, interface elements make corresponding adjustments to adapt to.RelativePanel can reduce some performance problems due to rearrange the elements.
As follows, both horizontal and vertical, blue button on the right side of the Texbox1, orange button on the blue button below.