Skip to content

WebViewNavigationCompletedEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for the WebView control NavigationCompleted event.

Environment behaviour

CLI — not supported. Never raised in the CLI: the events that pass it never fire there (WebView.NavigationCompleted).

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (WebView.NavigationCompleted).

Definition

public class WebViewNavigationCompletedEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

protected override void OnStart()
{
    var webView = new WebView();
    webView.NavigationCompleted += OnNavigationCompleted;
    Chart.AddControl(webView);
    webView.NavigateAsync("https://ctrader.com/");
}

private void OnNavigationCompleted(WebViewNavigationCompletedEventArgs args)
{
    Print("Navigation to {0} completed | Successful: {1} | HTTP status: {2}", args.Url, args.IsSuccessful, args.HttpStatusCode);
}
def on_start(self):
    webView = WebView()
    webView.NavigationCompleted += self.on_navigation_completed
    api.Chart.AddControl(webView)
    webView.NavigateAsync("https://ctrader.com/")

def on_navigation_completed(self, args):
    api.Print(f"Navigation to {args.Url} completed | Successful: {args.IsSuccessful} | HTTP status: {args.HttpStatusCode}")

Properties

Name Description
HttpStatusCodeDesktopCLICloudint Response HTTP status code.
IsSuccessfulDesktopCLICloudbool True if navigation was successful otherwise false.
UrlDesktopCLICloudstring URL from WebView Source property at the moment of NavigationCompleted in big process.
WebViewDesktopCLICloudWebView The WebView control.

See also