Skip to content

WebView2Wpf class

Attributes: [ToolboxItem(true)]

Defined in

Namespace: CrissCross.WPF Assembly: CrissCross.WPF.WebView2.dll Full name: CrissCross.WPF.WebView2Wpf Modifiers: public

Summary

View source

        Navigation Web View.
        

Applies to

net10.0-windows7.0, net9.0-windows7.0, net8.0-windows7.0, net481

Class hierarchy
classDiagram
class WebView2Wpf
class ContentControl
ContentControl <|-- WebView2Wpf
class IWebView2 {
    <>
}
IWebView2 <|.. WebView2Wpf
class IDisposable {
    <>
}
IDisposable <|.. WebView2Wpf

Inherits from: ContentControl

Implements: IWebView2, IDisposable

Constructors

NameSummary
.ctorInitializes a new instance of the [WebView2Wpf](# class.

Properties

NameSummary
AllowExternalDropGets or sets a value indicating whether [allow external drop].
CanGoBackGets a value indicating whether this instance can go back. if the WebView can navigate to a previous page in the navigation history. Wrapper around the...
CanGoForwardGets a value indicating whether this instance can go forward. if the WebView can navigate to a next page in the navigation history. Wrapper around the...
ContextMenuGets the context menu.
CoreWebView2Gets accesses the complete functionality of the underlying Microsoft.Web.WebView2.Core.CoreWebView2 COM API. Returns null until initialization has completed. See the...
CreationPropertiesGets or sets the creation properties.
DefaultBackgroundColorGets or sets the default color of the background.
DesignModeForegroundColorGets or sets the color of the design mode foreground.
EffectGets the effect.
FocusVisualStyleGets the focus visual style.
InputScopeGets the input scope.
OpacityGets the opacity.
OpacityMaskGets the opacity mask.
SourceGets or sets the source.
ZoomFactorGets or sets a value indicating whether [zoom factor].
ContentGets or sets the content of the XAML overlay />.
AutoDisposeGets or sets a value indicating whether [automatic dispose].

Fields

NameSummary
static AutoDisposePropertyThe automatic dispose property.
static AllowExternalDropPropertyThe allow external drop property.
static CanGoBackPropertyThe WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.CanGoBack property.
static CanGoForwardPropertyThe WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.CanGoForward property.
static CreationPropertiesPropertyThe WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.CreationProperties property.
static ContentPropertyThe navigate back is enabled property.
static DefaultBackgroundColorPropertyThe default background color property.
static DesignModeForegroundColorPropertyThe design mode foreground color property.
static SourcePropertyThe WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.Source property.
static ZoomFactorPropertyThe WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.ZoomFactor property.

Methods

NameSummary
DisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
EnsureCoreWebView2AsyncEnsures the core web view2 asynchronous.
ExecuteScriptAsyncExecutes JavaScript code from the javaScript parameter in the current top level document rendered in the WebView. Equivalent to calling...
GoBackNavigates the WebView to the previous page in the navigation history. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.GoBack on...
GoForwardNavigates the WebView to the next page in the navigation history. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.GoForward on...
NavigateToStringInitiates a navigation to htmlContent as source HTML of a new document. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String) ...
ReloadReloads the current page. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.Reload on Microsoft.Web.WebView2.Wpf.WebView2.CoreWebView2.
StopStops all navigations and pending resource fetches. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.Stop on Microsoft.Web.WebView2.Wpf.WebView2.CoreWebView2.
OnInitializedRaises the Initialized event. This method is invoked whenever...

Events

NameSummary
ContentLoadingOccurs when [content loading].
CoreWebView2InitializationCompletedOccurs when [core web view2 initialization completed].
NavigationCompletedOccurs when [navigation completed].
NavigationStartingOccurs when [navigation starting].
SourceChangedOccurs when [source changed].
WebMessageReceivedOccurs when [web message received].
ZoomFactorChangedOccurs when [zoom factor changed].
Inherited members

See also