检测设备是否支持亚克力笔刷

Detect whether Acrylic Brush is Supported in the device or not

As per Microsoft's Documentation,

Acrylic automatically adapts its appearance for a wide variety of devices and contexts.

In High Contrast mode, users continue to see the familiar background color of their choosing in place of acrylic. In addition, both background acrylic and in-app acrylic appear as a solid color

When the user turns off transparency in Personalization settings
When battery saver mode is activated
When the app runs on low-end hardware

In addition, only background acrylic will replace its transparency and texture with a solid color

When an app window on desktop deactivates
When the UWP app is running on phone, Xbox, HoloLens or tablet mode

我有两个关于亚克力刷的问题。

1) 是否可以检测低端设备何时禁用丙烯酸笔刷?

2) 是否有用户订阅 enable/disable 丙烯画笔的事件? 因为有一个设置可以在所有应用程序中切换丙烯画笔。

PS:我没有尝试使用后备颜色。

可以借助 UISettings.AdvancedEffectsEnabled 布尔值检查透明效果模式。

还有一个事件UISettings.AdvancedEffectsEnabled更改为订阅透明模式设置的更改。

    UISettings settings = new UISettings();

    private bool _IsTransparencyEnabled = settings.AdvancedEffectsEnabled;

    settings.AdvancedEffectsEnabledChanged += settings_AdvancedEffectsEnabledChanged;

    private void settings_ColorValuesChanged(UISettings sender, object args)
    {
        settings = (UISettings)sender;
        _IsTransparencyEnabled = settings.AdvancedEffectsEnabled;
        //TODOD: Do other necessary actions when transparency has changed.
    }