Skip to main content

NativeWebDialog Class

Definition

Assembly:Avalonia.Controls.WebView
Package:Avalonia.Controls.WebView

Avalonia.Controls.NativeWebDialog is a dialog window that hosts a native web browser implementation. It provides a way to display web content in a separate window, particularly useful for platforms like Linux where embedded WebView controls might not be available.

public class NativeWebDialog

Inheritance: object -> NativeWebDialog

Implements: IDisposable, ne, nf

Constructors

NameDescription
NativeWebDialogNo summary available.

NativeWebDialog Constructor

public NativeWebDialog()

Methods

NameDescription
CloseNo summary available.
DisposeNo summary available.
GoBackNo summary available.
GoForwardNo summary available.
InvokeScriptNo summary available.
MoveNo summary available.
NavigateNo summary available.
NavigateToStringNo summary available.
PrintToPdfStreamAsync (2 overloads)No summary available.
RefreshNo summary available.
ResizeNo summary available.
Show (2 overloads)No summary available.
ShowPrintUINo summary available.
StopNo summary available.
TryGetCommandManagerNo summary available.
TryGetCookieManagerNo summary available.
TryGetPlatformHandleNo summary available.
TryGetWebViewPlatformHandleGets platform handle of the webview hosted inside the dialog.
TryGetWindowIf dialog is based on a Avalonia.Controls.Window, returns its instance to allow full control.

Close Method

public void Close()

Dispose Method

public void Dispose()

GoBack Method

public bool GoBack()

Returns

bool

GoForward Method

public bool GoForward()

Returns

bool

InvokeScript Method

public System.Threading.Tasks.Task<string> InvokeScript(string script)

Parameters

script string

Returns

System.Threading.Tasks.Task<string>

Move Method

public bool Move(int x, int y)

Parameters

x int

y int

Returns

bool

public void Navigate(Uri url)

Parameters

url Uri

public void NavigateToString(string text)

Parameters

text string

PrintToPdfStreamAsync overloads

PrintToPdfStreamAsync Method

public System.Threading.Tasks.Task<System.IO.Stream> PrintToPdfStreamAsync()
Returns

System.Threading.Tasks.Task<System.IO.Stream>

PrintToPdfStreamAsync Method

public System.Threading.Tasks.Task<System.IO.Stream> PrintToPdfStreamAsync(Avalonia.Platform.WebViewPrintSettings printSettings)
Parameters

printSettings Avalonia.Platform.WebViewPrintSettings

Returns

System.Threading.Tasks.Task<System.IO.Stream>

Refresh Method

public bool Refresh()

Returns

bool

Resize Method

public bool Resize(int width, int height)

Parameters

width int

height int

Returns

bool

Show overloads

Show Method

public void Show()

Show Method

Opens the WebView dialog with Avalonia.Controls.TopLevel owner.

public void Show(Avalonia.Controls.TopLevel owner)
Parameters

owner Avalonia.Controls.TopLevel

ShowPrintUI Method

public void ShowPrintUI()

Stop Method

public bool Stop()

Returns

bool

TryGetCommandManager Method

public Avalonia.Controls.NativeWebViewCommandManager TryGetCommandManager()

Returns

Avalonia.Controls.NativeWebViewCommandManager

TryGetCookieManager Method

public Avalonia.Controls.NativeWebViewCookieManager TryGetCookieManager()

Returns

Avalonia.Controls.NativeWebViewCookieManager

TryGetPlatformHandle Method

public Avalonia.Platform.IPlatformHandle TryGetPlatformHandle()

Returns

Avalonia.Platform.IPlatformHandle

TryGetWebViewPlatformHandle Method

Gets platform handle of the webview hosted inside the dialog.

public Avalonia.Platform.IPlatformHandle TryGetWebViewPlatformHandle()

Returns

Avalonia.Platform.IPlatformHandle

TryGetWindow Method

If dialog is based on a Avalonia.Controls.Window, returns its instance to allow full control.

public Avalonia.Controls.Window TryGetWindow()

Returns

Avalonia.Controls.Window

Properties

NameDescription
CanGoBackNo summary available.
CanGoForwardNo summary available.
CanUserResizeNo summary available.
SourceNo summary available.
TitleNo summary available.

CanGoBack Property

public bool CanGoBack { get; set; }

CanGoForward Property

public bool CanGoForward { get; set; }

CanUserResize Property

public bool CanUserResize { get; set; }

Source Property

public Uri Source { get; set; }

Title Property

public string Title { get; set; }

Events

NameDescription
AdapterCreatedNo summary available.
AdapterDestroyedNo summary available.
ClosingNo summary available.
EnvironmentRequestedNo summary available.
NavigationCompletedNo summary available.
NavigationStartedNo summary available.
NewWindowRequestedNo summary available.
WebMessageReceivedNo summary available.
WebResourceRequestedNo summary available.

AdapterCreated Event

public event EventHandler<Avalonia.Controls.WebViewAdapterEventArgs> AdapterCreated

AdapterDestroyed Event

public event EventHandler<Avalonia.Controls.WebViewAdapterEventArgs> AdapterDestroyed

Closing Event

public event EventHandler Closing

EnvironmentRequested Event

public event EventHandler<Avalonia.Controls.WebViewEnvironmentRequestedEventArgs> EnvironmentRequested
public event EventHandler<Avalonia.Controls.WebViewNavigationCompletedEventArgs> NavigationCompleted
public event EventHandler<Avalonia.Controls.WebViewNavigationStartingEventArgs> NavigationStarted

NewWindowRequested Event

public event EventHandler<Avalonia.Controls.WebViewNewWindowRequestedEventArgs> NewWindowRequested

WebMessageReceived Event

public event EventHandler<Avalonia.Controls.WebMessageReceivedEventArgs> WebMessageReceived

WebResourceRequested Event

public event EventHandler<Avalonia.Controls.WebResourceRequestedEventArgs> WebResourceRequested