diff --git a/Sources/Stim/AddGameMessagePopup.xaml.cs b/Sources/Stim/AddGameMessagePopup.xaml.cs
deleted file mode 100644
index 6bbee1d..0000000
--- a/Sources/Stim/AddGameMessagePopup.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using CommunityToolkit.Maui.Views;
-
-namespace Stim;
-
-public partial class AddGameMessagePopup : Popup
-{
- public AddGameMessagePopup(string message)
- {
- InitializeComponent();
- placeholder.Text = message;
- }
-
- public void CloseButton(object sender, EventArgs e)
- {
- Close();
- }
-}
\ No newline at end of file
diff --git a/Sources/Stim/AddGamePage.xaml.cs b/Sources/Stim/AddGamePage.xaml.cs
index 7655369..db7d2c8 100644
--- a/Sources/Stim/AddGamePage.xaml.cs
+++ b/Sources/Stim/AddGamePage.xaml.cs
@@ -34,7 +34,7 @@ public partial class AddGamePage : ContentPage
}
// //if (_ImgPath!=null) NameEntry.Text + ".png";
// //System.IO.File.Copy(_ImgPath, /**/, true);
- await this.ShowPopupAsync(new AddGameMessagePopup(message));
+ await this.ShowPopupAsync(new MessagePopup(message));
}
private async void Button_Clicked(object sender, EventArgs e)
diff --git a/Sources/Stim/DetailledPage.xaml.cs b/Sources/Stim/DetailledPage.xaml.cs
index cc3b869..ceae734 100644
--- a/Sources/Stim/DetailledPage.xaml.cs
+++ b/Sources/Stim/DetailledPage.xaml.cs
@@ -1,3 +1,4 @@
+using CommunityToolkit.Maui.Views;
using Model;
using StimPersistance;
@@ -39,8 +40,9 @@ public partial class DetailledPage : ContentPage
//popup add review
}
- private void AddFollow(object sender, EventArgs e)
+ private async void AddFollow(object sender, EventArgs e)
{
+ await this.ShowPopupAsync(new MessagePopup("Jeu ajouté dans les suivis !"));
((App)App.Current).Manager.CurrentUser.FollowAGame(CurrGame);
}
}
\ No newline at end of file
diff --git a/Sources/Stim/EntryPopup.xaml b/Sources/Stim/EntryPopup.xaml
new file mode 100644
index 0000000..2a0b30b
--- /dev/null
+++ b/Sources/Stim/EntryPopup.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/Stim/EntryPopup.xaml.cs b/Sources/Stim/EntryPopup.xaml.cs
new file mode 100644
index 0000000..05fed6b
--- /dev/null
+++ b/Sources/Stim/EntryPopup.xaml.cs
@@ -0,0 +1,17 @@
+using CommunityToolkit.Maui.Views;
+
+namespace Stim;
+
+public partial class EntryPopup : Popup
+{
+ public EntryPopup(string fieldName)
+ {
+ InitializeComponent();
+ LabelTxt.Text = fieldName;
+ }
+
+ public void CloseButton(object sender, EventArgs e)
+ {
+ if (!string.IsNullOrWhiteSpace(Entrytxt.Text)) Close(Entrytxt.Text);
+ }
+}
\ No newline at end of file
diff --git a/Sources/Stim/FollowPage.xaml b/Sources/Stim/FollowPage.xaml
index 6211459..6e99c7b 100644
--- a/Sources/Stim/FollowPage.xaml
+++ b/Sources/Stim/FollowPage.xaml
@@ -16,10 +16,10 @@
-
-
+
+
-
+
diff --git a/Sources/Stim/AddGameMessagePopup.xaml b/Sources/Stim/MessagePopup.xaml
similarity index 76%
rename from Sources/Stim/AddGameMessagePopup.xaml
rename to Sources/Stim/MessagePopup.xaml
index c95c9f9..e11d84c 100644
--- a/Sources/Stim/AddGameMessagePopup.xaml
+++ b/Sources/Stim/MessagePopup.xaml
@@ -2,10 +2,11 @@
-
-
+
+
+
diff --git a/Sources/Stim/MessagePopup.xaml.cs b/Sources/Stim/MessagePopup.xaml.cs
new file mode 100644
index 0000000..cb24256
--- /dev/null
+++ b/Sources/Stim/MessagePopup.xaml.cs
@@ -0,0 +1,17 @@
+using CommunityToolkit.Maui.Views;
+
+namespace Stim;
+
+public partial class MessagePopup : Popup
+{
+ public MessagePopup(string message)
+ {
+ InitializeComponent();
+ placeholder.Text = message;
+ }
+
+ public void CloseButton(object sender, EventArgs e)
+ {
+ Close();
+ }
+}
\ No newline at end of file
diff --git a/Sources/Stim/ProfilPage.xaml.cs b/Sources/Stim/ProfilPage.xaml.cs
index 2e88124..f7fcf8b 100644
--- a/Sources/Stim/ProfilPage.xaml.cs
+++ b/Sources/Stim/ProfilPage.xaml.cs
@@ -1,3 +1,4 @@
+using CommunityToolkit.Maui.Views;
using Model;
namespace Stim;
@@ -14,4 +15,11 @@ public partial class ProfilPage : ContentPage
{
((App)App.Current).Manager.CurrentUser.RemoveAGame((sender as CollectionView).SelectedItem as Game);
}
+
+ private async void ChangeUsername(object sender, EventArgs e)
+ {
+ var newName = await this.ShowPopupAsync(new EntryPopup("Username"));
+ if (string.IsNullOrWhiteSpace(newName as string)) await this.ShowPopupAsync(new MessagePopup("Nom d'utilisateur invalide"));
+ else ((App)App.Current).Manager.CurrentUser.ChangeUsername(newName as string);
+ }
}
\ No newline at end of file
diff --git a/Sources/Stim/Stim.csproj b/Sources/Stim/Stim.csproj
index 6c8d998..7103552 100644
--- a/Sources/Stim/Stim.csproj
+++ b/Sources/Stim/Stim.csproj
@@ -77,9 +77,6 @@
-
- MSBuild:Compile
-
MSBuild:Compile
@@ -89,12 +86,18 @@
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile