Question : Silverlight Slider

How do I get this code to work?  With each tick I want the sliderPositionBackground.Value to be updated with the Position of the media.  Is this doable?  How?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Private timer As New DispatcherTimer()

   Public Sub New()
      InitializeComponent()

      AddHandler Loaded, AddressOf MainPage_Loaded

      timer.Interval = TimeSpan.FromSeconds(0.1)
      AddHandler timer.Tick, AddressOf timer_Tick
   End Sub

   Private Sub timer_Tick(ByVal sender As Object, ByVal e As EventArgs)
      sliderPositionBackground.Value = media.Position.Milliseconds
   End Sub


--XAML
        <MediaElement Source="" Grid.Row="0" Grid.ColumnSpan="7" x:Name="media" AutoPlay="False" Volume="1" VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Uniform" Visibility="Visible" BufferingTime="00:00:05"></MediaElement>

        <Slider  Grid.Row="2" Grid.Column="3" HorizontalAlignment="Left" Name="sliderPositionBackground" VerticalAlignment="Center" Width="345" Margin="1" Opacity="0.5" />

Answer : Silverlight Slider

Random Solutions  
 
programming4us programming4us