diff --git a/MusiLib/MusiLib/Model/Metronome.cs b/MusiLib/MusiLib/Model/Metronome.cs
index 3cdc267..54cf7df 100644
--- a/MusiLib/MusiLib/Model/Metronome.cs
+++ b/MusiLib/MusiLib/Model/Metronome.cs
@@ -9,7 +9,7 @@ namespace MusiLib.Model
{
public class Metronome
{
- static AudioPlayer player;
+ /*static AudioPlayer player;
static bool isMusicPlaying = false;
static bool isMusicBeginning = false;
@@ -40,7 +40,7 @@ namespace MusiLib.Model
isMusicPlaying = false;
isMusicBeginning = false;
}
- }
+ }*/
}
}
diff --git a/MusiLib/MusiLib/Views/Accueil.xaml b/MusiLib/MusiLib/Views/Accueil.xaml
index 9816b20..c99dbe6 100644
--- a/MusiLib/MusiLib/Views/Accueil.xaml
+++ b/MusiLib/MusiLib/Views/Accueil.xaml
@@ -69,20 +69,12 @@
Clicked="GoToFavorisButton"
/>
-
-
-
diff --git a/MusiLib/MusiLib/Views/Favoris.xaml.cs b/MusiLib/MusiLib/Views/Favoris.xaml.cs
index 5ec8feb..fc88389 100644
--- a/MusiLib/MusiLib/Views/Favoris.xaml.cs
+++ b/MusiLib/MusiLib/Views/Favoris.xaml.cs
@@ -1,3 +1,5 @@
+using System.Diagnostics;
+
namespace MusiLib.Views;
public partial class Favoris : ContentPage, IAllowClick
diff --git a/MusiLib/MusiLib/Views/IPlayMusic.cs b/MusiLib/MusiLib/Views/IPlayMusic.cs
index 9651b90..65af743 100644
--- a/MusiLib/MusiLib/Views/IPlayMusic.cs
+++ b/MusiLib/MusiLib/Views/IPlayMusic.cs
@@ -30,7 +30,7 @@ namespace MusiLib.Views
public static void stopMusic()
{
- if(isMusicBeginning)
+ if(isMusicBeginning)
{
player.Stop();
isMusicPlaying = false;
diff --git a/MusiLib/MusiLib/Views/Partition.xaml b/MusiLib/MusiLib/Views/Partition.xaml
index a10861c..2e0fb91 100644
--- a/MusiLib/MusiLib/Views/Partition.xaml
+++ b/MusiLib/MusiLib/Views/Partition.xaml
@@ -1,107 +1,107 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MusiLib/MusiLib/Views/Partition.xaml.cs b/MusiLib/MusiLib/Views/Partition.xaml.cs
index 9a44aa8..46f4dbb 100644
--- a/MusiLib/MusiLib/Views/Partition.xaml.cs
+++ b/MusiLib/MusiLib/Views/Partition.xaml.cs
@@ -1,6 +1,6 @@
-
using Microsoft.Maui.Controls.PlatformConfiguration;
using MusiLib.Model;
+using System.Diagnostics;
namespace MusiLib.Views;
@@ -35,8 +35,8 @@ public partial class Partition : ContentPage
IPlayMusic.pauseMusic();
button.Text = "Jouer";
}
-
}
+
private void Stop_Music(object sender, EventArgs e)
{
IPlayMusic.stopMusic();
@@ -49,4 +49,24 @@ public partial class Partition : ContentPage
IPlayMusic.stopMusic();
return base.OnBackButtonPressed();
}
-}
\ No newline at end of file
+
+ protected override void OnDisappearing()
+ {
+ base.OnDisappearing();
+ IPlayMusic.stopMusic();
+ }
+
+ protected override void OnAppearing()
+ {
+ base.OnAppearing();
+ Shell.Current.Navigating += Shell_Navigating;
+ }
+
+ private void Shell_Navigating(object sender, ShellNavigatingEventArgs e)
+ {
+ if (e.Source == ShellNavigationSource.ShellItemChanged)
+ {
+ IPlayMusic.stopMusic();
+ }
+ }
+}