Raises a UserEvent with an optional set of arguments.

Example

Here is a very basic example showing how you can raise a UserEvent from JavaScript.

<UserEvent ux:Name="myEvent" />

<JavaScript>
    myEvent.raise();
</JavaScript>

The following example raises an event with some arguments 5 seconds after JavaScript has started executing, and logs its arguments in the event handler.

<UserEvent ux:Name="myEvent" />
<OnUserEvent EventName="myEvent" Handler="{eventHandler}" />

<JavaScript>
    setTimeout(function() {

        myEvent.raise({
            userName: "james",
            isAdmin: false
        });

    }, 5000);

    function eventHandler(args) {
        console.log("User name: " + args.userName);
        console.log("Is admin: " + args.isAdmin);
    }

    module.exports = { eventHandler: eventHandler };
</JavaScript>

Location

Namespace
Fuse
Package
Fuse.UserEvents 2.9.1