troubleshooting Question

Silverlight Slider

Avatar of RayT
RayTFlag for United States of America asked on
Microsoft DevelopmentASP.NET
2 Comments1 Solution484 ViewsLast Modified:
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?
Private timer As New DispatcherTimer()

   Public Sub New()

      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

        <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" />
Anil Golamari
Full Stack Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros