Compartilhar via


CoreWebView2Controller.ZoomFactor Property

Definition

Gets or sets the zoom factor for the WebView.

public double ZoomFactor { get; set; }
member this.ZoomFactor : double with get, set
Public Property ZoomFactor As Double

Property Value

Remarks

Note that changing zoom factor may cause window.innerWidth or window.innerHeight and page layout to change. A zoom factor that is applied by the host by setting this ZoomFactor property becomes the new default zoom for the WebView. This zoom factor applies across navigations and is the zoom factor WebView is returned to when the user presses Ctrl+0. When the zoom factor is changed by the user (resulting in the app receiving ZoomFactorChanged), that zoom applies only for the current page. Any user applied zoom is only for the current page and is reset on a navigation. Specifying a ZoomFactor less than or equal to 0 is not allowed. WebView also has an internal supported zoom factor range. When a specified zoom factor is out of that range, it is normalized to be within the range, and a ZoomFactorChanged event is raised for the real applied zoom factor. When this range normalization happens, this reports the zoom factor specified during the previous modification of the ZoomFactor property until the ZoomFactorChanged event is received after WebView applies the normalized zoom factor.

Applies to