Hello Amyo,
I've tried everyhting you said. Looks like no error is generated...BUT...nothing seems to happen.
By the way, I'm using VB. Here is a sample of my code. If you could spot anything wrong, it would be very appreciated. The XAML file contains a buffering Canvas element called BufferingArea. There's also a media element called vid.
Here's the portion of my code behind for Page.xaml.vb which fires when vid is buffering:
Private Sub showbuffer(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)Dim bufferCalcul As New Buffering
bufferCalcul.display(sender, e)
End Sub
And here's the custom class Buffering containing the displaybuffer method :
Public Class Buffering
Inherits UserControl
Private
xamlpage As Page
Public Sub displaybuffer(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
'Buffering Verification
If xamlpage.vid.BufferingProgress < 0.99 Then
If xamlpage.splash.Visibility = Windows.Visibility.Collapsed Then
xamlpage.BufferingArea.Visibility = Windows.Visibility.Visible
Canvas.SetLeft(xamlpage.BufferingArea, Application.Current.Host.Content.ActualWidth / 2 - 75)
Canvas.SetTop(xamlpage.BufferingArea, Application.Current.Host.Content.ActualHeight / 2 - 100)
xamlpage.ConnectingText.Text =
"buffering " + (Math.Round((xamlpage.vid.BufferingProgress * 100), 3).ToString) + "%"
Else
xamlpage.progressload.Visibility = Windows.Visibility.Visible
xamlpage.progressload.Value = Math.Round(xamlpage.vid.BufferingProgress * 100)
End If
Else
xamlpage.BufferingArea.Visibility = Windows.Visibility.Collapsed
xamlpage.progressload.Visibility = Windows.Visibility.Collapsed
xamlpage.DataloadTXT.Visibility = Windows.Visibility.Collapsed
End IfEnd Sub
End
Class