问题
Apparently the effect is a feature introduced in the Creator's Update. Has anyone figured out the exact APIs used to pull this off? Even better would be some example code to at least help get me started.
Any help would be greatly appreciated. :]
回答1:
You should target Windows Creators Update for it to work
using Windows.UI.Xaml.Hosting;
//'this' is MainPage, but can be any UIElement
var visual = ElementCompositionPreview.GetElementVisual(this);
var brush = visual.Compositor.CreateHostBackdropBrush();
var sprite = visual.Compositor.CreateSpriteVisual();
sprite.Brush = brush;
//Set to the size of the area, update on SizeChanged
sprite.Size = new System.Numerics.Vector2(1000, 1000);
ElementCompositionPreview.SetElementChildVisual(this, sprite);
来源:https://stackoverflow.com/questions/43566178/how-to-replicate-the-window-transparency-effect-found-in-the-new-dropbox-uwp-app