PlaySoundAction
.NET프로그래밍/Silverlight 3.0 2009. 12. 7. 18:44 |아래그림과 같이 '솔루션 탐색기'에서 '오디오파일'인 "Silverlight4.wma"를 추가하고("ClientBin"폴더에도 "Silverlight4.wma"파일을 추가했음) [FrmPlaySoundAction.xaml]을 'Expression Blend'를 사용해서 '오디오파일'을 실행한다.
[FrmPlaySoundAction.xaml]
<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="RiaAction.FrmPlaySoundAction"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
<Button Margin="96,86,88,104" RenderTransformOrigin="0.5,0.5" FontSize="26.667" Content="오디오 파일 실행">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="48.988"/>
<TranslateTransform/>
</TransformGroup>
</Button.RenderTransform>
<i:Interaction.Triggers>
<i:EventTrigger EventName="Click">
<im:PlaySoundAction Source="Silverlight4.wma"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</Grid>
</UserControl>
'.NET프로그래밍 > Silverlight 3.0' 카테고리의 다른 글
MouseDragElementBehavior (0) | 2009.12.07 |
---|---|
FluidMoveBehavior (0) | 2009.12.07 |
HyperlinkAction (0) | 2009.12.07 |
ControlStoryboardAction (0) | 2009.12.07 |
RemoveElementAction - 클릭하면 사라지는 동작 (0) | 2009.12.07 |