Share via


WebView2.DefaultBackgroundColor 屬性

定義

取得或設定當 HTML 內容未指定色彩時,要當做 WebView2 背景使用的色彩。

public:
 property Color DefaultBackgroundColor { Color get(); void set(Color value); };
/// [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
/// [get: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
/// [set: Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
Color DefaultBackgroundColor();

void DefaultBackgroundColor(Color value);
[Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")]
public Color DefaultBackgroundColor { [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")] get; [Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValue(value="WebView2::sc_controllerDefaultBackgroundColor")] set; }
var color = webView2.defaultBackgroundColor;
webView2.defaultBackgroundColor = color;
Public Property DefaultBackgroundColor As Color
<WebView DefaultBackgroundColor="predefinedColorName"/>
- or -
<WebView DefaultBackgroundColor="#rgb"/>
- or -
<WebView DefaultBackgroundColor="#argb"/>
- or -
<WebView DefaultBackgroundColor="#rrggbb"/>
- or -
<WebView DefaultBackgroundColor="#aarrggbb"/>
- or -
<WebView DefaultBackgroundColor="sc#scR,scG,scB"/>
- or -
<WebView DefaultBackgroundColor="sc#scA,scR,scG,scB"/>

屬性值

背景色彩。

屬性
Microsoft.UI.Xaml.CustomAttributes.MUXPropertyDefaultValueAttribute

適用於