Silverlight

83.SilverLight3 - PlaySoundAction

Godffs 2009. 12. 7. 14:45
반응형
PlaySoundAction
- 오디오 파일 재생
- 지원 되는 파일 : mp3, asf, asx,wma,wmv

MainPage.xaml [Expression Blend 3]
   버튼 컨트롤 추가

[그림 83-1]


MainPage.xaml [Expression Blend 3]
자산-동작-PlaySoundAction 적용하기

[그림 83-2]


[그림 83-3]


결과확인
   버튼을 클릭하시면 재생됩니다~

[그림 83-4]


<UserControl

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"

    xmlns:im="clr-namespace:Microsoft.Expression.Interactivity.Media;

              assembly=Microsoft.Expression.Interactions" x:Class="PlaySoundAction.MainPage"

    d:DesignHeight="300" d:DesignWidth="400">

 

    <Grid x:Name="LayoutRoot" Background="White">

        <Button Height="37" HorizontalAlignment="Left" Margin="8,8,0,0" VerticalAlignment="Top"

                Width="140" Content=" ">

            <i:Interaction.Triggers>

                <i:EventTrigger EventName="Click">

                    <im:PlaySoundAction Source=".mp3" Volume="1"/>

                </i:EventTrigger>

            </i:Interaction.Triggers>

        </Button>

     </Grid>

</UserControl>


반응형