& Lt; Win10 Development & gt; some tips ., Win10 development tips

Source: Internet
Author: User

<Win10 development> some tips ., Win10 development tips

 

This article shares some scattered little knowledge about UWP development.

1. Set the minimum size of the application

It is mainly used on PCs. UWA can be played by the mouse at will on PCs, which can be large or small. The responsive design of the interface is a major feature. However, in some cases, we still need to consider that there are a lot of App interface elements, and the window will not be able to be placed any longer, so it will not look good. Medium,

The size of the flat bar of the IT house is the default minimum size for each UWA.

In order to display the information for at least three days, users are not allowed to adjust it too short.

The calculator makes the minimum size smaller than the default size, allowing itself to become an ultra-small window.

The following code sets the minimum size of the App, which is also 400x700.

applicationView.SetPreferredMinSize(new Size(400, 700));

 

2. slide into the animation in sequence during the pivotitem Switching

When the pivotitem switching option is selected, the entire page slides in the switching direction by default. In fact, there is another way to slide in sequence, which is interesting. In the WP8 era, a third-party Library provides this effect. Now UWP comes with it.

Assign a group to the child controls in pivotitem. Different Groups slide in sequence from sequence to sequence. Controls of the same group will slide in at the same time.

For example, <TextBlock consumer. SlideInAnimationGroup = "1"/>

The effect is as follows:

 

3. Modify the title style of a sequence.

You can modify the headerTempplate. The following code uses textblock as the header of the watermark and modifies the font size of the title.

<Symbol x: Uid = "symbol"> <symbol. headerTemplate> <DataTemplate> <TextBlock Text = "{Binding}" FontSize = "21"/> </DataTemplate> </Pivot emplate. headerTemplate> <shorttitem x: Uid = "shorttitem1" Header = "Search"> </shorttitem> </short>

4. Understand the platform currently running

UWA can run on multiple platforms. Some background operations need to be differentiated between the platforms currently running. You can access Windows. ApplicationModel. Resources. Core. ResourceContext.

The DeviceFamily values include Desktop and Mobile...

Example:

1 ResourceContext resourceContext =ResourceContext.GetForCurrentView();2             3 if (resourceContext.QualifierValues["DeviceFamily"] == "Desktop")4 {5        applicationView.SetPreferredMinSize(new Size(400, 700));6 }

 

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.