Example #1
0
    async void UpdatePosition(object sender, HtmlEventArgs e)
    {
        X += e.MovementX;
        Y += e.MovementY;

        if (X > canvasWidth + RADIUS)
        {
            X = -RADIUS;
        }
        if (Y > canvasHeight + RADIUS)
        {
            Y = -RADIUS;
        }
        if (X < -RADIUS)
        {
            X = canvasWidth + RADIUS;
        }
        if (Y < -RADIUS)
        {
            Y = canvasHeight + RADIUS;
        }

        await tracker.SetProperty("textContent", $"X position: {X} Y position: {Y}");

        if (animation == null)
        {
            animation = animationCallback;
            await window.Invoke <object>("requestAnimationFrame", animation);
        }
    }
 public static HtmlWindow open(this HtmlWindow window, string URL = null, string name = null, string specs = null, string replace = null)
 {
     return(window.Invoke("open", URL, name, specs, replace) as HtmlWindow);
 }