Triggers and actions

Learn more about triggers and actions, what they are used for and which triggers and actions are available.

A control can execute additional functions (actions) after an event, e.g. show a dialog if the user clicks on the control. To do that, a control needs a trigger such as a click event.

Trigger

A trigger triggers an action in a control.

The following triggers are available:

  • ControlEventTrigger

    Is triggered if an event occurs in the control, e.g. a click on the control. The EventName property sets the control event that will initiate the trigger if that event is raised.

    Depending on the control, the following events are available in the EventName property:

    • onInitialized

      Is triggered during the initialization of the control, i.e. when it is called for the first time after application start.

      This event can be used to initialize variables or to set the default color.
    • onAttached

      Is triggered when the page where the control is located is loaded. This event is suppressed for preloaded pages. For a preloaded page, the event is raised when the page is visibly loaded, i.e. displayed.

    • onDetached

      Is triggered when the page where the control is located is unloaded, e.g. if the user navigates to another page.

    • onHoverChanged

      Is raised if the mouse hovers over the control. This event is not raised in touch-operated applications.

    • onCheckedChanged

      Is triggered if the Checked property of the control changes, i.e. from true to false or vice versa. The trigger passes the Checked property value on to the action(s) in the trigger value.

    • onFocusedChanged

      Is triggered if the Focused property of the control changes. The trigger passes the Focused property value on to the action(s) in the trigger value.

    • onNavigated

      Is triggered upon navigation, when the new view is displayed in the region.

      This event can be used to load the temperature values into a new variable, before the view is displayed.
    • onNavigating

      Is triggered upon navigation, before the new view is displayed in the region.

      This event can be used to load the temperature values into a new variable, before the view is displayed.
    • onPressedChanged

      Is triggered if the Pressed property changes. The trigger passes the Pressed property value on to the action(s) in the trigger value.

    • onVisibilityChanged

      Is triggered if the Visibility property changes. The trigger passes the Visibility property value on to the action(s) in the trigger value.

    • onDisabledChanged

      Is triggered if the Disabled property changes. The trigger passes the Disabled property value on to the action(s) in the trigger value.

    • onButtonClick

      Is triggered if the user clicks or taps on the control. The event is raised concurrently with the onUp event.

    • onSelectedIndexChanged

      Is triggered if the SelectedIndex property changes.

    • onBarIndicatorChanged

      Is triggered if the position of the Bar indicator changes.

    • onThumbPositionChanged

      Is triggered if the position of the Slider thumb indicator changes.

    • onValueChanged

      Is triggered if the variable or the user input changes.

    • onClick

      Is triggered if the user clicks or taps on the control. The event is raised concurrently with the onUp event.

    • onDown

      Is triggered if the user clicks or taps on the control.

    • onUp

      Is triggered when the control is released after being clicked or tapped.

  • ControlPropertyTrigger

    Is triggered if a property of the control changes. The PropertyName property sets the control property that will initiate the trigger if that property changes.

    The drop-down menu of the PropertyName property only contains properties that are editable in the currently selected style of the control. If you reset the style of the control, the drop-down will contain all properties of that control.
  • VariableTrigger

    Is triggered if the variable changes. Th VariableName property sets the variable that will initiate the trigger if that variable changes. Th VariableProperty property specifies which property of the triggering variable is passed on to the actions in the trigger value.

Actions

An action is a function that is executed upon an event defined by the trigger, e.g. a user input or a variable value change.

The Add Action dialog shows all available actions. All actions have a tool tip describing the selected action. To show the tool tip in the dialog, hold your mouse above the name of the action you want to know more about. The tool tip appears shortly after.