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" />
|