Class WebBrowser
Provides a control that hosts an HTML page in an app using an iframe. Note: some websites explicitly forbid being embedded in an iframe. Note: to embed a piece of HTML code without using an iframe, use the HtmlPresenter control instead.
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class WebBrowser : FrameworkElement
Fields
| Improve this Doc View SourceSourceProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty SourceProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SourceUriProperty
Gets or sets the Uniform Resource Identifier (URI) source of the HTML content to display in the control inside an iframe. Note: some websites explicitly forbid being embedded in an iframe. Note: to embed a piece of HTML code without using an iframe, use the HtmlPresenter control instead.
Declaration
public static readonly DependencyProperty SourceUriProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceSource
Declaration
[NotImplemented]
public Uri Source { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
SourceUri
Gets or sets the Uniform Resource Identifier (URI) source of the HTML content to display in the control inside an iframe. Note: some websites explicitly forbid being embedded in an iframe. Note: to embed a piece of HTML code without using an iframe, use the HtmlPresenter control instead.
Declaration
public Uri SourceUri { get; set; }
Property Value
Type | Description |
---|---|
System.Uri |
Methods
| Improve this Doc View SourceCreateDomElement(Object, out Object)
Declaration
public override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type | Name | Description |
---|---|---|
System.Object | parentRef | |
System.Object | domElementWhereToPlaceChildren |
Returns
Type | Description |
---|---|
System.Object |
Overrides
| Improve this Doc View SourceInvokeScript(String)
Executes a script function that is implemented by the currently loaded document.
Declaration
[NotImplemented]
public object InvokeScript(string scriptName)
Parameters
Type | Name | Description |
---|---|---|
System.String | scriptName | The name of the script function to execute. |
Returns
Type | Description |
---|---|
System.Object | The object returned by the Active Scripting call. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException |
InvokeScript(String, Object[])
Executes a script function that is defined in the currently loaded document.
Declaration
[NotImplemented]
public object InvokeScript(string scriptName, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String | scriptName | The name of the script function to execute. |
System.Object[] | args | The parameters to pass to the script function. |
Returns
Type | Description |
---|---|
System.Object | The object returned by the Active Scripting call. |
Navigate(Uri)
Loads the HTML content at the specified Uniform Resource Identifier (URI) inside an iframe. Note: some websites explicitly forbid being embedded in an iframe. Note: to embed a piece of HTML code without using an iframe, use the HtmlPresenter control instead.
Declaration
public void Navigate(Uri source)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | source | The Uniform Resource Identifier (URI) to load. |
NavigateToString(String)
Displays the specified HTML content inside an iframe. Note: to embed a piece of HTML code without using an iframe, use the HtmlPresenter control instead.
Declaration
public void NavigateToString(string text)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The HTML content to display in the control. |
SaveToString()
Declaration
[NotImplemented]
public string SaveToString()
Returns
Type | Description |
---|---|
System.String |
Events
| Improve this Doc View SourceLoadCompleted
Occurs when top-level navigation completes and the content loads into the WebBrowser control or when an error occurs during loading.
Declaration
public event LoadCompletedEventHandler LoadCompleted
Event Type
Type | Description |
---|---|
LoadCompletedEventHandler |
ScriptNotify
Occurs when the content contained in the WebBrowser control passes a string to the Silverlight plug-in by using JavaScript.
Declaration
[NotImplemented]
public event EventHandler<NotifyEventArgs> ScriptNotify
Event Type
Type | Description |
---|---|
System.EventHandler<NotifyEventArgs> |