UWP Acrylic Material, uwpacrylic

Source: Internet
Author: User

UWP Acrylic Material, uwpacrylic

Document: https://docs.microsoft.com/en-us/windows/uwp/design/style/acrylic

Acrylic can bring glass effects similar to those of win7

To use Acrylic, the minimum version of win10 is 1709, Which is 16299 in the simulator.

 

There are two types of Acrylic:

  • Background acrylic
  • In-app acrylic

As the name suggests, one is for the application background, and the other is for the application to pop up the mask layer.

 

Win10 comes with many acrylic resources, which can be used directly.

For example, for Background acrylic:

SystemControlAcrylicWindowBrush,
SystemControlChromeLowAcrylicWindowBrush,
SystemControlBaseHighAcrylicWindowBrush,
SystemControlBaseLowAcrylicWindowBrush,
SystemControlAltHighAcrylicWindowBrush,
SystemControlAltLowAcrylicWindowBrush

 

In-app acrylic needs to be used:

SystemControlAcrylicElementBrush ,
SystemControlChromeLowAcrylicElementBrush ,
SystemControlBaseHighAcrylicElementBrush ,
SystemControlBaseLowAcrylicElementBrush ,
SystemControlAltHighAcrylicElementBrush ,
SystemControlAltLowAcrylicElementBrush

 

The simple effect is as follows:

<Grid. Background> <AcrylicBrush BackgroundSource = "HostBackdrop" TintColor = "# FFFF0000" Opacity = "0.6" FallbackColor = "Black"> </AcrylicBrush> </Grid. Background>

Running and discovering wood works...

Then try to write it as Resource:

    <Page.Resources>        <AcrylicBrush x:Key="MyAcrylicBrush"                      BackgroundSource="HostBackdrop"                      TintColor="#FFFF0000"                      TintOpacity="0.6" TintTransitionDuration="1"                      FallbackColor="Black"/>    </Page.Resources>    <Grid  Background="{StaticResource MyAcrylicBrush}">    </Grid>

The effect is as follows:

Therefore, it is ineffective to write AcrylicBrush directly.

You can try to write a Resource...

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.