Windowscommunitytoolkit: Compatibility: What happens if you use a feature that requires a more recent build?

Created on 27 Mar 2017  路  6Comments  路  Source: windows-toolkit/WindowsCommunityToolkit

I want to use the Blur Effect in my application, but it says it's only for the Anniversary Update (or newer).

If I add it to my application (in XAML), will it make it fail in older builds. Will it render?

How can I add the blur effect if the build supports it? Should I modify the target framework to make it work, and reduce the devices in which my app can run?

Most helpful comment

The blur extension defines this
public static bool IsBlurSupported =>
聽聽聽聽聽聽聽聽聽聽聽聽ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3); // SDK >= 14393

All 6 comments

private bool UseMediaPlayerElement => ApiInformation.IsTypePresent("Windows.UI.Xaml.Controls.MediaPlayerElement");

Query for support in similar fashion

The blur extension defines this
public static bool IsBlurSupported =>
聽聽聽聽聽聽聽聽聽聽聽聽ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 3); // SDK >= 14393

OK, it's clear now, but is there any good way to add it conditionally in XAML?

No i suggest you do this in code behind.

And because the control is already testing this bit, if you use it in your app with an incompatible build it will just do nothing (no crash)

@SuperJMN what @deltakosh said is correct. I haven't used blur (at all), My bad.
http://docs.uwpcommunitytoolkit.com/en/master/animations/Blur/ shows how to use the blur behaviour either in code or in XAML.

Was this page helpful?
0 / 5 - 0 ratings