views:

26

answers:

0

Hi,

I have this UserControl:

<UserControl x:Class="Jugues.contacteButton"
         x:Name="contacteButtonControl"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" >
<UserControl.Template>
    <ControlTemplate>
        <Grid   x:Name="grid_container"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch">
            <Image x:Name="img_contact"
                   Source="IMG\btn.png"
                   />
            <MediaElement x:Name="media_click"
                          Soruce="snd\clap.mp3"
                          Volume="1"/>

        </Grid>
        <ControlTemplate.Triggers>
            <Trigger SourceName="img_contact" Property="IsMouseOver" Value="true">
                <Setter TargetName="img_contact" Property="Source" Value="IMG\btn_over.png" />
            </Trigger>
            <Trigger SourceName="img_contact" Property="IsMouseOver" Value="false">
                <Setter TargetName="img_contact" Property="Source" Value="IMG\btn.png" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</UserControl.Template>

How can I play the sound from the MediaElement using only XAML?