diff --git a/ViewsApp/ViewsApp/AppShell.xaml b/ViewsApp/ViewsApp/AppShell.xaml
index 98bf854..2ef3ea7 100644
--- a/ViewsApp/ViewsApp/AppShell.xaml
+++ b/ViewsApp/ViewsApp/AppShell.xaml
@@ -7,22 +7,12 @@
xmlns:views="clr-namespace:ViewsApp.Views"
Shell.FlyoutBehavior="Disabled">
-
-
-
-
-
-
+
+
diff --git a/ViewsApp/ViewsApp/Resources/Raw/Sounds/au_clair_de_la_lune.mp3 b/ViewsApp/ViewsApp/Resources/Raw/Sounds/au_clair_de_la_lune.mp3
new file mode 100644
index 0000000..9551d00
Binary files /dev/null and b/ViewsApp/ViewsApp/Resources/Raw/Sounds/au_clair_de_la_lune.mp3 differ
diff --git a/ViewsApp/ViewsApp/Views/Accueil.xaml b/ViewsApp/ViewsApp/Views/Accueil.xaml
index 0e5941e..921db48 100644
--- a/ViewsApp/ViewsApp/Views/Accueil.xaml
+++ b/ViewsApp/ViewsApp/Views/Accueil.xaml
@@ -67,14 +67,15 @@
Margin="0,5,0,0"
VerticalOptions="Start"
HorizontalOptions="End"
- Clicked="GoToFavoris"
+ Clicked="GoToFavorisButton"
/>
-
+ BackgroundColor="Blue"
+ Clicked="GoToPartitionButton"/>
diff --git a/ViewsApp/ViewsApp/Views/Accueil.xaml.cs b/ViewsApp/ViewsApp/Views/Accueil.xaml.cs
index da299c7..41f948d 100644
--- a/ViewsApp/ViewsApp/Views/Accueil.xaml.cs
+++ b/ViewsApp/ViewsApp/Views/Accueil.xaml.cs
@@ -1,14 +1,29 @@
namespace ViewsApp.Views;
-public partial class Accueil : ContentPage
+public partial class Accueil : ContentPage, IAllowClick
{
public Accueil()
{
InitializeComponent();
}
- private void GoToFavoris(object sender, EventArgs e)
+ private void GoToFavorisButton(object sender, EventArgs e)
{
+ if (!IAllowClick.AllowTap) return;
+ else IAllowClick.AllowTap = false;
+
Navigation.PushAsync(new Favoris());
+
+ IAllowClick.ResumeTap();
+ }
+
+ private void GoToPartitionButton(object sender, EventArgs e)
+ {
+ if (!IAllowClick.AllowTap) return;
+ else IAllowClick.AllowTap = false;
+
+ Navigation.PushAsync(new Partition());
+
+ IAllowClick.ResumeTap();
}
}
\ No newline at end of file
diff --git a/ViewsApp/ViewsApp/Views/Favoris.xaml b/ViewsApp/ViewsApp/Views/Favoris.xaml
index ddd2d3d..1482cf4 100644
--- a/ViewsApp/ViewsApp/Views/Favoris.xaml
+++ b/ViewsApp/ViewsApp/Views/Favoris.xaml
@@ -35,7 +35,7 @@
HeightRequest="60"
VerticalOptions="Start"
HorizontalOptions="Start"
- Clicked="GoToAccueilByLogo"
+ Clicked="GoToAccueilByLogoButton"
/>
+
diff --git a/ViewsApp/ViewsApp/Views/Favoris.xaml.cs b/ViewsApp/ViewsApp/Views/Favoris.xaml.cs
index 4ef48d7..582a165 100644
--- a/ViewsApp/ViewsApp/Views/Favoris.xaml.cs
+++ b/ViewsApp/ViewsApp/Views/Favoris.xaml.cs
@@ -1,14 +1,31 @@
namespace ViewsApp.Views;
-public partial class Favoris : ContentPage
+public partial class Favoris : ContentPage, IAllowClick
{
public Favoris()
{
InitializeComponent();
}
- private void GoToAccueilByLogo(object sender, EventArgs e)
+
+ private void GoToAccueilByLogoButton(object sender, EventArgs e)
{
- Navigation.PushAsync(new Accueil());
+ if (!IAllowClick.AllowTap) return;
+ else IAllowClick.AllowTap = false;
+
+ Navigation.PopAsync();
+
+ IAllowClick.ResumeTap();
+ }
+
+
+ private void GoToPartitionButton(object sender, EventArgs e)
+ {
+ if (!IAllowClick.AllowTap) return;
+ else IAllowClick.AllowTap = false;
+
+ Navigation.PushAsync(new Partition());
+
+ IAllowClick.ResumeTap();
}
}
\ No newline at end of file
diff --git a/ViewsApp/ViewsApp/Views/IAllowClick.cs b/ViewsApp/ViewsApp/Views/IAllowClick.cs
new file mode 100644
index 0000000..a6ab1ce
--- /dev/null
+++ b/ViewsApp/ViewsApp/Views/IAllowClick.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ViewsApp.Views
+{
+ public interface IAllowClick
+ {
+ public static bool AllowTap = true;
+
+ public static async void ResumeTap()
+ {
+ await Task.Delay(500);
+ AllowTap = true;
+ }
+ }
+}
diff --git a/ViewsApp/ViewsApp/Views/Partition.xaml b/ViewsApp/ViewsApp/Views/Partition.xaml
index 6ae0188..3e05b23 100644
--- a/ViewsApp/ViewsApp/Views/Partition.xaml
+++ b/ViewsApp/ViewsApp/Views/Partition.xaml
@@ -20,6 +20,8 @@
-
+
+
+
\ No newline at end of file
diff --git a/ViewsApp/ViewsApp/Views/Partition.xaml.cs b/ViewsApp/ViewsApp/Views/Partition.xaml.cs
index 43adc8c..8e20cae 100644
--- a/ViewsApp/ViewsApp/Views/Partition.xaml.cs
+++ b/ViewsApp/ViewsApp/Views/Partition.xaml.cs
@@ -1,5 +1,7 @@
+using System.Diagnostics;
using ViewsApp.Model;
+
namespace ViewsApp.Views;
public partial class Partition : ContentPage
@@ -12,7 +14,15 @@ public partial class Partition : ContentPage
InitializeComponent();
listUtil.BindingContext = MyManager;
- }
+ }
+ private void Button_Clicked(object sender, EventArgs e)
+ {
+ var player = new Windows.Media.Playback.MediaPlayer();
+ var uri = new Uri($"C:/Users/Utilisateur/Documents/Cours/SAE/SAE_201/ViewsApp/ViewsApp/Resources/Raw/au_clair_de_la_lune.mp3");
+ player.SetUriSource(uri);
+ player.Volume = 0.5;
+ player.Play();
+ }
}
\ No newline at end of file