Sound Player Action demo : SoundPlayerAction « Windows Presentation Foundation « C# / CSharp Tutorial






<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Button>A Button With Sounds
    <Button.Triggers>
      <EventTrigger RoutedEvent="Button.Click">
        <EventTrigger.Actions>
          <SoundPlayerAction Source="click.wav"/>
        </EventTrigger.Actions>
      </EventTrigger>
      <EventTrigger RoutedEvent="Button.MouseEnter">
        <EventTrigger.Actions>
          <SoundPlayerAction Source="hover.wav"/>
        </EventTrigger.Actions>
      </EventTrigger>
    </Button.Triggers>
  </Button>
</Canvas>
WPF Sound Player Action








24.163.SoundPlayerAction
24.163.1.Sound Player Action demoSound Player Action demo
24.163.2.Play audio through event triggerPlay audio through event trigger