// Handles the Click event on the Button inside the Popup control and
// closes the Popup.
private void ClosePopupClicked(object sender, RoutedEventArgs e)
{
// if the Popup is open, then close it
if (StandardPopup.IsOpen) { StandardPopup.IsOpen = false; }
}
// Handles the Click event on the Button on the page and opens the Popup.
private void ShowPopupOffsetClicked(object sender, RoutedEventArgs e)
{
// open the Popup if it isn't open already
if (!StandardPopup.IsOpen) { StandardPopup.IsOpen = true; }
}
1 回答
是的 . 以下示例取自其Microsoft的Popup类文档,here:
代码隐藏:
XAML:
只需更改
Border
对象的Background
依赖项属性即可:至
您的Popup将设置为Acrylic背景(这是在为其视觉状态之一定义的NavigationView模板中的Acrylic Brush资源) .
或者您始终可以创建自己的Acrylic Brush资源:
使用此功能,您可以将Border Background属性设置为自定义资源,如下所示:
并调整设置以获得您正在努力的外观 . BackgroundSource设置为HostBackDrop,要使用背景丙烯酸,将色调覆盖层设置为相当透明的值,而将TintColor设置为完全不透明蓝色 .
结果:
如果你想将
Background
属性定义为任何控件的Acrylic brush
,如果你的目标是使用Falls Creator更新的应用程序,我认为这个问题应该是另一种方式:我在哪里无法利用新发布的功能?