Skip to content

PlaySoundAction

Jon W Chu edited this page Nov 16, 2015 · 1 revision

PlaySoundAction represents an action that will play a sound to completion.

This Behaviors triggers the playing of a specified sound from Source at Volume level.

Sample Code

XAML

<Button x:Name="button">
    <Interactivity:Interaction.Behaviors>
        <Interactions:EventTriggerBehavior EventName="Click" SourceObject="{Binding ElementName=button}">
            <Media:PlaySoundAction Source="Assets/Ding.mp3" Volume="1"/>
        </Interactions:EventTriggerBehavior>
    </Interactivity:Interaction.Behaviors>
</Button>