Vibrate the device for a duration or by vibration type (only on iOS)

You'll find this trigger action in the Fuse.Vibration package, which have to be referenced from your uno project. For example:

{
    "Packages": [
        "Fuse",
        "FuseJS",
        "Fuse.Vibration"
    ]
  }

Example

<StackPanel Margin="20">
    <Button Margin="10" Text="Vibrate">
        <Clicked>
            <Vibrate Duration="5" />
        </Clicked>
    </Button>
</StackPanel>

On iOS you can do vibration by leveraging Taptic Engine. There are 9 types of vibration :

  • Soft
  • Rigid
  • Light
  • Medium
  • Heavy
  • Success
  • Warning
  • Error
  • Selection To activate it, just pass those value to VibrationType property

##Example

<StackPanel Margin="20">
    <!-- Works on iOS using Taptic Engine -->
    <Button Margin="10" Text="Heavy Vibrate">
        <Clicked>
            <Vibrate VibrationType="Heavy" />
        </Clicked>
    </Button>
</StackPanel>

Location

Namespace
Fuse.Vibration
Package
Fuse.Vibration 2.9.1
Show Uno properties and methods

Interface of Vibrate

Inherited from TriggerAction

AtProgress : float ux

A value between 0 and 1 for when the action should be performed. Alternative to Delay.

Delay : float ux

The number of seconds after the start of the trigger that the action should be performed.

TargetNode : Node ux

The node that the action targets. If not specified then the enclsoing Trigger will be used. Several triggers can look for a target starting from this point. Some triggers require a Target to be specified.

Unroot uno

Called when the owner of this object is unrooted. This gives an action to cleanup resources or cancel pending actions.

Inherited from PropertyObject

Inherited from object

Attached UX Attributes

GlobalKey (attached by Resource) : string ux

The ux:Global attribute creates a global resource that is accessible everywhere in UX markup.

Implemented Interfaces