locked
No music playback RRS feed

  • Question

  • Hi, I made the below XAML with Blend 3 (a moving text and background music), but when I play it in Blend 3, no music is played. However, when I "run project", the music is played. How can I play the music in Blend 3 so that I can work on syncing with the music and etc.? Thanks.

    -------------
    <UserControl
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        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="ct.MainPage"
        Width="640" Height="480">
        <UserControl.Resources>
            <Storyboard x:Name="Storyboard1">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="00:00:04.8000000" Value="139"/>
                    <EasingDoubleKeyFrame KeyTime="00:00:09.3000000" Value="-12"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                    <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="00:00:04.8000000" Value="84"/>
                    <EasingDoubleKeyFrame KeyTime="00:00:09.3000000" Value="211"/>
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </UserControl.Resources>

        <Grid x:Name="LayoutRoot" Background="White">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Loaded">
                    <im:ControlStoryboardAction Storyboard="{StaticResource Storyboard1}"/>
                </i:EventTrigger>
                <i:EventTrigger EventName="Loaded" SourceName="LayoutRoot">
                    <im:PlaySoundAction Source="/ct.mp3" Volume="1"/>
                </i:EventTrigger>
            </i:Interaction.Triggers>
            <TextBlock x:Name="textBlock" Height="85" Margin="192,109,275,0" VerticalAlignment="Top" Text="CT" TextWrapping="Wrap" RenderTransformOrigin="0.5,0.5">
                <TextBlock.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </TextBlock.RenderTransform>
            </TextBlock>
        </Grid>
    </UserControl>
    ----------------------
    Wednesday, November 18, 2009 1:05 PM