Window.SystemBackdrop 属性

定义

获取或设置要应用于此 Window的系统背景。 背景呈现在内容后面 Window

public:
 property SystemBackdrop ^ SystemBackdrop { SystemBackdrop ^ get(); void set(SystemBackdrop ^ value); };
SystemBackdrop SystemBackdrop();

void SystemBackdrop(SystemBackdrop value);
public SystemBackdrop SystemBackdrop { get; set; }
var systemBackdrop = window.systemBackdrop;
window.systemBackdrop = systemBackdrop;
Public Property SystemBackdrop As SystemBackdrop

属性值

要应用于此 Window的系统背景。

示例

此示例演示如何设置 SystemBackdrop 以使用 Mica Alt

<Window
    ...>
    <Window.SystemBackdrop>
        <MicaBackdrop Kind="BaseAlt"/>
    </Window.SystemBackdrop>

    <Grid RowDefinitions="*,*">
        <!-- This area has a transparent background, so the Mica
         backdrop will be mostly visible. For example, if there are
         buttons here, the backdrop will show up in the margins
         and gaps between the buttons. -->
        <Grid Background="Transparent"></Grid>

        <!-- This area has an opaque background,
         so the Mica backdrop won't be visible. -->
        <Grid Grid.Row="1" Background="Gray"></Grid>
    </Grid>
</Window>
public MainWindow()
{
    this.InitializeComponent();

    SystemBackdrop = new MicaBackdrop() 
                        { Kind = MicaKind.BaseAlt };
}

注解

有关系统背景的详细信息,请参阅Windows 11中的材料

背景呈现在 Window.Content 中指定的内容后面。 如果所有内容都完全不透明,则此背景将没有可见效果。

适用于

另请参阅