diff --git a/MusiLib/MusiLib/MusiLib.csproj b/MusiLib/MusiLib/MusiLib.csproj
index 75bb62f..4a6c318 100644
--- a/MusiLib/MusiLib/MusiLib.csproj
+++ b/MusiLib/MusiLib/MusiLib.csproj
@@ -56,4 +56,10 @@
+
+
+ PartitionView.xaml
+
+
+
diff --git a/MusiLib/MusiLib/Views/Accueil.xaml b/MusiLib/MusiLib/Views/Accueil.xaml
index 7f58fb4..0aa3bdf 100644
--- a/MusiLib/MusiLib/Views/Accueil.xaml
+++ b/MusiLib/MusiLib/Views/Accueil.xaml
@@ -51,6 +51,7 @@
PlaceholderColor="White"
VerticalTextAlignment="Center"
HorizontalTextAlignment="Start"
+ TextChanged="SearchBar_TextChanged"
/>
(App.Current as App).MyManager;
+
+ private List partitionsInitiales;
+
public Accueil()
{
InitializeComponent();
@@ -33,7 +37,7 @@ public partial class Accueil : ContentPage, IAllowClick
if (int.TryParse(idAutomation, out int id))
{
- Navigation.PushAsync(new Partition(id));
+ Navigation.PushAsync(new PartitionView(id));
}
@@ -43,6 +47,8 @@ public partial class Accueil : ContentPage, IAllowClick
private void chargerPartitions()
{
+ partitionsInitiales = MyManager.partitions.ToList();
+
int imagesParLigne = 3;
int indice = 0;
@@ -89,4 +95,18 @@ public partial class Accueil : ContentPage, IAllowClick
}
}
+ private void SearchBar_TextChanged(object sender, TextChangedEventArgs e)
+ {
+ string texteRecherche = e.NewTextValue;
+
+ MyManager.partitions.Clear();
+
+ foreach (Model.Partition partition in partitionsInitiales)
+ {
+ if (partition.Nom.ToLower().Contains(texteRecherche.ToLower()))
+ {
+ MyManager.partitions.Add(partition);
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/MusiLib/MusiLib/Views/Favoris.xaml.cs b/MusiLib/MusiLib/Views/Favoris.xaml.cs
index ed899cf..902a31b 100644
--- a/MusiLib/MusiLib/Views/Favoris.xaml.cs
+++ b/MusiLib/MusiLib/Views/Favoris.xaml.cs
@@ -38,7 +38,7 @@ public partial class Favoris : ContentPage, IAllowClick
if (int.TryParse(idAutomation, out int id))
{
- Navigation.PushAsync(new Partition(id));
+ Navigation.PushAsync(new PartitionView(id));
}
IAllowClick.ResumeTap();
diff --git a/MusiLib/MusiLib/Views/Partition.xaml b/MusiLib/MusiLib/Views/PartitionView.xaml
similarity index 97%
rename from MusiLib/MusiLib/Views/Partition.xaml
rename to MusiLib/MusiLib/Views/PartitionView.xaml
index aca857c..7ae5b71 100644
--- a/MusiLib/MusiLib/Views/Partition.xaml
+++ b/MusiLib/MusiLib/Views/PartitionView.xaml
@@ -1,112 +1,112 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MusiLib/MusiLib/Views/Partition.xaml.cs b/MusiLib/MusiLib/Views/PartitionView.xaml.cs
similarity index 95%
rename from MusiLib/MusiLib/Views/Partition.xaml.cs
rename to MusiLib/MusiLib/Views/PartitionView.xaml.cs
index e481c81..c4608f5 100644
--- a/MusiLib/MusiLib/Views/Partition.xaml.cs
+++ b/MusiLib/MusiLib/Views/PartitionView.xaml.cs
@@ -5,7 +5,7 @@ using System.Diagnostics;
namespace MusiLib.Views;
-public partial class Partition : ContentPage
+public partial class PartitionView : ContentPage
{
public Manager MyManager => (App.Current as App).MyManager;
@@ -13,13 +13,13 @@ public partial class Partition : ContentPage
public int IdTab { get; set; }
- public Partition()
+ public PartitionView()
{
InitializeComponent();
BindingContext = MyManager;
}
- public Partition(int id)
+ public PartitionView(int id)
{
InitializeComponent();
IdTab = id;