Reputation: 1798
I am trying to play a wav sound on a button click:
I am trying to use the soundplayeractionclass.
http://msdn.microsoft.com/en-us/library/system.windows.controls.soundplayeraction.aspx
Here is a xaml snippet
<UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="Button.Click" SourceName="btnSave">
<EventTrigger.Actions>
<SoundPlayerAction Source="Media\notify.wav"/>
</EventTrigger.Actions>
</EventTrigger>
</UserControl.Triggers>
It is not liking me using UserControl.Triggers any recommended approaches for this behavior?
Thanks.
Upvotes: 1
Views: 92