<UserControl x:Class="ApSilverlight.SilverlightAudio"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="300" Width="400">

  <Grid x:Name="LayoutRoot" Background="Linen">
    <Grid.RowDefinitions>
      <RowDefinition />
      <RowDefinition Height="Auto"/>
      <RowDefinition />
    </Grid.RowDefinitions>

    <MediaElement x:Name="meReproductor" AutoPlay="False" MediaEnded="meReproductor_MediaEnded"
                  Source="/ApSilverlight;component/Media/Pretenders.mp3"
                  MediaFailed="meReproductor_MediaFailed"
                  CurrentStateChanged="meReproductor_CurrentStateChanged" MediaOpened="meReproductor_MediaOpened">
    </MediaElement>

    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
            VerticalAlignment="Center" Margin="5">
      <Button Name="btReproducir" Content="Reproducir"
          Width="70" Margin="5" Click="btReproducir_Click"/>
      <Button Name="btParar" Content="Parar" Width="70" Margin="5"
          Click="btParar_Click"/>
      <Button Name="btPausa" Content="Pausa" Width="70" Margin="5"
          Click="btPausa_Click"/>
      <CheckBox Margin="8" Content="Repetir" x:Name="chbRepetir"/>
      <CheckBox Margin="8" Content="Silencio" x:Name="chbSilencio"
            Click="chbSilencio_Click"/>
    </StackPanel>

    <Grid Grid.Row="1" Margin="0,10,0,0">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto"/>
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition />
      </Grid.ColumnDefinitions>

      <TextBlock Margin="5" Text="Volumen: "/>
      <Slider Grid.Column="1" x:Name="sliderVolumen"
        Minimum="0" Maximum="1" Value="0.5"
        ValueChanged="sliderVolumen_ValueChanged" />
      <TextBlock Grid.Row="1" Margin="5" Text="Balance: "/>
      <Slider Grid.Row="1" Grid.Column="1" x:Name="sliderBalance"
        Minimum="-1" Maximum="1"
        ValueChanged="sliderBalance_ValueChanged" />
      <TextBlock Grid.Row="2" Margin="5" Text="Posición: "/>
      <Slider Grid.Column="1" Grid.Row="2"  x:Name="sliderPosicion"
        Minimum="0" />
    </Grid>

    <TextBlock Grid.Row="2" x:Name="tbkEstado" Text="00:00:00"
               Margin="10" HorizontalAlignment="Center"/>
  </Grid>
</UserControl>
