diff --git a/specs/CoreWebView2ControllerOptions.DefaultBackgroundColor.md b/specs/CoreWebView2ControllerOptions.DefaultBackgroundColor.md index 29e541f4..16d7bfd8 100644 --- a/specs/CoreWebView2ControllerOptions.DefaultBackgroundColor.md +++ b/specs/CoreWebView2ControllerOptions.DefaultBackgroundColor.md @@ -47,7 +47,7 @@ applies the color too late. m_environment->CreateCoreWebView2ControllerWithOptions( m_mainWindow, - SUCCEEDED(result) ? options4.Get() : options.Get(), + options.Get(), Callback( this, &AppWindow::OnCreateCoreWebView2ControllerCompleted).Get()); @@ -66,12 +66,14 @@ public MainWindow() SetDefaultBackgroundColor(); } -private void SetDefaultBackgroundColor() +private async Task +SetDefaultBackgroundColor() { - CoreWebView2Environment environment = CoreWebView2Environment.CreateAsync(); + CoreWebView2Environment environment = await + CoreWebView2Environment.CreateAsync(); CoreWebView2ControllerOptions options = environment.CreateCoreWebView2ControllerOptions(); options.DefaultBackgroundColor = Color.FromArgb(255, 85, 0, 255); - WebView2.EnsureCoreWebView2Async(environment, options); + await WebView2.EnsureCoreWebView2Async(environment, options); } ``` @@ -101,10 +103,11 @@ interface ICoreWebView2ControllerOptions4 : ICoreWebView2ControllerOptions3 { /// the `DefaultBackgroundColor` property to render the background. /// By default, this color is set to white. /// - /// Currently this API only supports opaque colors and transparency. It will - /// fail for colors with alpha values that don't equal 0 or 255 ie. translucent - /// colors are not supported. When WebView2 is set to have a transparent background, - /// it renders the content of the parent window behind it. + /// Currently this API only supports opaque colors and full transparency. It will + /// this means it will fail for colors with alpha values that don't equal 0 or 255. + /// When WebView2 is set to have a transparent background, + /// it does not render a background, allowing the content from windows behind it to be visible. + [propget] HRESULT DefaultBackgroundColor([out, retval] COREWEBVIEW2_COLOR* value); [propput] HRESULT DefaultBackgroundColor([in] COREWEBVIEW2_COLOR value);