显然,该效果是创作者更新中引入的一项功能。有没有人想出用于实现这一目标的确切 API?更好的是一些示例代码至少可以帮助我入门。
如有任何帮助,我们将不胜感激。 :]
最佳答案
您应该针对 Windows Creators Update 使其工作
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);
关于c# - 如何复制新 DropBox UWP 应用中的窗口透明效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43566178/