Does Windows 10 Mobile support the Fluent Design S

2019-06-08 23:34发布

问题:

I'm developing a new UWP app with the Fluent Design System (Acrylic Background and reveal) but apart from being available on Windows 10 Desktop, I also want to publish the application to Windows 10 Mobile. Does Windows 10 Mobile support the Fluent Design System? Or do I have to develop another application just for Windows 10 Mobile without the Fluent Design System?

回答1:

Windows 10 Mobile build 10.0.15063 (Creators Update) supports composition effects as well as in-app acrylic (see How to use Acrylic Accent in Windows 10 Creators Update?) and reveal effects via the composition API.

However, it does not support the AcrylicBrush or RevealBrush classes, as those classes are only available in build 10.0.16299 (Fall Creators Update) or later, which is not available for mobile devices (the current feature branch is build 10.0.15254, which is also dubbed the "Fall Creators Update" but does not actually include the new APIs).

While it is possible to incorporate Fluent Design elements into your Windows 10 Mobile app for devices running the Windows 10 Mobile Creators Update, doing so is far more trouble than it's worth. You will need to avoid using AcrylicBrush and RevealBrush since they're not available to mobile devices, and you will need to do in-app acrylic and reveal effects the hard way.

You don't need to make a separate app for mobile; if your minimum target version is 10.0.15063 you can use conditional XAML to serve a legacy resource dictionary to mobile devices and Fluent Design to PCs. If your minimum target version is an older version that doesn't support conditional XAML, you need to use Windows.Foundation.Metadata.ApiInformation.IsTypePresent() to check for AcrylicBrush and/or RevealBrush and merge the appropriate resource dictionary into your Application.Current.Resources manually.



回答2:

To use this brush you should know that it works if:

  1. Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

  2. API contract Windows.Foundation.UniversalApiContract (introduced v5)

More information https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.acrylicbrush