WebView2Wpf class¶
Attributes: [ToolboxItem(true)]
Defined in
Namespace: CrissCross.WPF
Assembly: CrissCross.WPF.WebView2.dll
Full name: CrissCross.WPF.WebView2Wpf
Modifiers: public
Summary¶
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¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [WebView2Wpf](# class. |
Properties¶
| Name | Summary |
|---|---|
| AllowExternalDrop | Gets or sets a value indicating whether [allow external drop]. |
| CanGoBack | Gets 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... |
| CanGoForward | Gets 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... |
| ContextMenu | Gets the context menu. |
| CoreWebView2 | Gets accesses the complete functionality of the underlying Microsoft.Web.WebView2.Core.CoreWebView2 COM API. Returns null until initialization has completed. See the... |
| CreationProperties | Gets or sets the creation properties. |
| DefaultBackgroundColor | Gets or sets the default color of the background. |
| DesignModeForegroundColor | Gets or sets the color of the design mode foreground. |
| Effect | Gets the effect. |
| FocusVisualStyle | Gets the focus visual style. |
| InputScope | Gets the input scope. |
| Opacity | Gets the opacity. |
| OpacityMask | Gets the opacity mask. |
| Source | Gets or sets the source. |
| ZoomFactor | Gets or sets a value indicating whether [zoom factor]. |
| Content | Gets or sets the content of the XAML overlay />. |
| AutoDispose | Gets or sets a value indicating whether [automatic dispose]. |
Fields¶
| Name | Summary |
|---|---|
| static AutoDisposeProperty | The automatic dispose property. |
| static AllowExternalDropProperty | The allow external drop property. |
| static CanGoBackProperty | The WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.CanGoBack property. |
| static CanGoForwardProperty | The WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.CanGoForward property. |
| static CreationPropertiesProperty | The WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.CreationProperties property. |
| static ContentProperty | The navigate back is enabled property. |
| static DefaultBackgroundColorProperty | The default background color property. |
| static DesignModeForegroundColorProperty | The design mode foreground color property. |
| static SourceProperty | The WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.Source property. |
| static ZoomFactorProperty | The WPF DependencyProperty which backs the Microsoft.Web.WebView2.Wpf.WebView2.ZoomFactor property. |
Methods¶
| Name | Summary |
|---|---|
| Dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. |
| EnsureCoreWebView2Async | Ensures the core web view2 asynchronous. |
| ExecuteScriptAsync | Executes JavaScript code from the javaScript parameter in the current top level document rendered in the WebView. Equivalent to calling... |
| GoBack | Navigates the WebView to the previous page in the navigation history. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.GoBack on... |
| GoForward | Navigates the WebView to the next page in the navigation history. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.GoForward on... |
| NavigateToString | Initiates a navigation to htmlContent as source HTML of a new document. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.NavigateToString(System.String) ... |
| Reload | Reloads the current page. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.Reload on Microsoft.Web.WebView2.Wpf.WebView2.CoreWebView2. |
| Stop | Stops all navigations and pending resource fetches. Equivalent to calling Microsoft.Web.WebView2.Core.CoreWebView2.Stop on Microsoft.Web.WebView2.Wpf.WebView2.CoreWebView2. |
| OnInitialized | Raises the Initialized event. This method is invoked whenever... |
Events¶
| Name | Summary |
|---|---|
| ContentLoading | Occurs when [content loading]. |
| CoreWebView2InitializationCompleted | Occurs when [core web view2 initialization completed]. |
| NavigationCompleted | Occurs when [navigation completed]. |
| NavigationStarting | Occurs when [navigation starting]. |
| SourceChanged | Occurs when [source changed]. |
| WebMessageReceived | Occurs when [web message received]. |
| ZoomFactorChanged | Occurs when [zoom factor changed]. |