problème creation bouton play et pause.
Bonjour,
Je suis en train d'essayer de créer un player video pour l'intégrer à un site web, mais je me vois bloquer devant la limite de mes compétences!
Quand je rentre le code ci dessous et que je souhaite lancer l'application avec silverlight celui-ci m'envoie un message d'erreur
Citation:
Le type ou le nom d'espace de noms "MainPage" est introuvable (une directive d'using ou une référence d'assembly est elle manquante?) ligne 28
Etant complètement novice je ne comprend absoluement pas ou est mon erreur.
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| InitializeComponent();
}
private void timeline_ValueChanged(
object sender, RoutedPropertyChangedEventArgs<double> e) {
long ticks = (long)((sender as Slider).Value *
this.moviePlayer.NaturalDuration.TimeSpan.Ticks);
TimeSpan movieTimespan = new TimeSpan(ticks);
this.moviePlayer.Position = movieTimespan;
if (this.moviePlayer.CurrentState == MediaElementState.Playing) {
this.moviePlay.IsChecked = true;
this.moviePlay.Content = "Pause";
}
}
L'erreur se produirait sur cette ligne
private void movieStop_Click(object sender, RoutedEventArgs e) {
this.timeline.Value = 0;
this.moviePlayer.Stop();
this.moviePlay.Content = "Play";
}
private void moviePlay_Click(object sender, RoutedEventArgs e) {
if (moviePlay.IsChecked == true) {
moviePlay.Content = "Pause";
this.moviePlayer.Play();
}
else {
moviePlay.Content = "Play";
this.moviePlayer.Pause();
}
}
private void movieMute_Click(object sender, RoutedEventArgs e) {
if (movieMute.IsChecked == true) {
movieMute.Content = "Sound On";
this.moviePlayer.IsMuted = true;
}
else {
movieMute.Content = "Sound Off";
this.moviePlayer.IsMuted = false; |
Si vous avez des idées n'hésitez pas je suis preneur :lol:
Merci d'avance
problème creation bouton play et pause.
Je rectifie l'erreur se produit sur le fichier Appxmls.cs
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| namespace SilverlightApplication19
{
public partial class App : Application
{
public App()
{
this.Startup += this.Application_Startup;
this.Exit += this.Application_Exit;
this.UnhandledException += this.Application_UnhandledException;
InitializeComponent();
}
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();l'erreur étant ici
} private void Application_Exit(object sender, EventArgs e)
{
} |