WinUI3 變更背景

WinUI3 預設的背景依照系統的深色/淺色模式是黑色或白色的,看起來有點死板,可以使用下面的方式調整背景。

預設背景如下:

在 MainWindow.cs 中可以使用下面的方式設定背景:

雲母

霧面質感
    
this.SystemBackdrop = new MicaBackdrop(); 
    


壓克力

霧面透明
    
this.SystemBackdrop = new DesktopAcrylicBackdrop();
    


完全透明

需要 安裝 WinUIEx 套件,才可以使用:
    
this.SystemBackdrop = new WinUIEx.TransparentTintBackdrop();
    


也可以調整底色:
    
this.SystemBackdrop = new WinUIEx.TransparentTintBackdrop()
{
    TintColor = Windows.UI.Color.FromArgb(180, 255, 0, 0)
};
    



參考資料:
WinUIEx - Custom Backdrops

留言