Skip to content

PlaySoundAction

branh edited this page Dec 4, 2018 · 1 revision

PlaySoundAction plays some sound.

This behavior causes the sound file located at Source Uri to be played at Volume when it is triggered.

SampleCode

Xaml

<Button x:Name="button">
  <Behaviors:Interaction.Triggers>
    <Behaviors:EventTrigger EventName="Click" SourceObject="{Binding ElementName=button}">
      <Behaviors:PlaySoundAction Source="../../Assets/Cheer.mp3" Volume="1.0" />
    </Behaviors:EventTrigger>
  </Behaviors:Interaction.Triggers>
</Button>