diff --git a/Sources/AppConsole/AppConsole.csproj b/Sources/AppConsole/AppConsole.csproj
index 998522f..41c23f5 100644
--- a/Sources/AppConsole/AppConsole.csproj
+++ b/Sources/AppConsole/AppConsole.csproj
@@ -7,6 +7,10 @@
enable
+
+
+
+
diff --git a/Sources/Persistance/Persistance.csproj b/Sources/Persistance/Persistance.csproj
index 5ebf888..1131d75 100644
--- a/Sources/Persistance/Persistance.csproj
+++ b/Sources/Persistance/Persistance.csproj
@@ -6,6 +6,10 @@
enable
+
+
+
+
diff --git a/Sources/Stim.Model/Model.csproj b/Sources/Stim.Model/Model.csproj
index 4658cbf..3b1ca2b 100644
--- a/Sources/Stim.Model/Model.csproj
+++ b/Sources/Stim.Model/Model.csproj
@@ -6,4 +6,8 @@
enable
+
+
+
+
diff --git a/Sources/Stim/AddGameMessagePopup.xaml b/Sources/Stim/AddGameMessagePopup.xaml
new file mode 100644
index 0000000..c95c9f9
--- /dev/null
+++ b/Sources/Stim/AddGameMessagePopup.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/Sources/Stim/AddGameMessagePopup.xaml.cs b/Sources/Stim/AddGameMessagePopup.xaml.cs
new file mode 100644
index 0000000..6bbee1d
--- /dev/null
+++ b/Sources/Stim/AddGameMessagePopup.xaml.cs
@@ -0,0 +1,17 @@
+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 b/Sources/Stim/AddGamePage.xaml
index 480c30f..102f203 100644
--- a/Sources/Stim/AddGamePage.xaml
+++ b/Sources/Stim/AddGamePage.xaml
@@ -1,6 +1,7 @@
diff --git a/Sources/Stim/AddGamePage.xaml.cs b/Sources/Stim/AddGamePage.xaml.cs
index 3f99154..7655369 100644
--- a/Sources/Stim/AddGamePage.xaml.cs
+++ b/Sources/Stim/AddGamePage.xaml.cs
@@ -1,6 +1,7 @@
using Model;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Application = Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific.Application;
+using CommunityToolkit.Maui.Views;
//using Windows.Gaming.Preview.GamesEnumeration;
namespace Stim;
@@ -15,16 +16,25 @@ public partial class AddGamePage : ContentPage
private string? _ImgPath;
- private void AddGame(object sender, EventArgs e)
+ private async void AddGame(object sender, EventArgs e)
{
int year;
string imgName = "no_cover.png";
- if (string.IsNullOrEmpty(NameEntry.Text) || string.IsNullOrEmpty(DescriptionEntry.Text) || string.IsNullOrEmpty(YearEntry.Text) || !int.TryParse(YearEntry.Text, out year) || string.IsNullOrWhiteSpace(LinkEntry.Text) /*|| _ImgPath is null*/) return;
- //if (_ImgPath!=null) NameEntry.Text + ".png";
- //System.IO.File.Copy(_ImgPath, /**/, true);
- ((App)App.Current).Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, year, new List { TagEntry1.Text, TagEntry2.Text, TagEntry3.Text }, imgName, LinkEntry.Text));
- Navigation.RemovePage(this);
- ((App)App.Current).Manager.SaveGames();
+ string message = "";
+ if (string.IsNullOrEmpty(NameEntry.Text)) message += "Nom invalide\n";
+ if (string.IsNullOrEmpty(DescriptionEntry.Text)) message += "Description invalide\n";
+ if (string.IsNullOrEmpty(YearEntry.Text) || !int.TryParse(YearEntry.Text, out year)) message += "Année invalide\n";
+ if (string.IsNullOrEmpty(LinkEntry.Text)) message += "Lien invalide\n";
+ if (!string.IsNullOrEmpty(NameEntry.Text) && !string.IsNullOrEmpty(DescriptionEntry.Text) && !string.IsNullOrEmpty(YearEntry.Text) && int.TryParse(YearEntry.Text, out year) && !string.IsNullOrWhiteSpace(LinkEntry.Text) /*|| _ImgPath is null*/)
+ {
+ message = "Jeu ajouté !";
+ ((App)App.Current).Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, year, new List { TagEntry1.Text, TagEntry2.Text, TagEntry3.Text }, imgName, LinkEntry.Text));
+ Navigation.RemovePage(this);
+ ((App)App.Current).Manager.SaveGames();
+ }
+ // //if (_ImgPath!=null) NameEntry.Text + ".png";
+ // //System.IO.File.Copy(_ImgPath, /**/, true);
+ await this.ShowPopupAsync(new AddGameMessagePopup(message));
}
private async void Button_Clicked(object sender, EventArgs e)
diff --git a/Sources/Stim/DetailledPage.xaml b/Sources/Stim/DetailledPage.xaml
index 0e1ab2c..77ee91d 100644
--- a/Sources/Stim/DetailledPage.xaml
+++ b/Sources/Stim/DetailledPage.xaml
@@ -17,17 +17,15 @@
-
-
-
+
-
-
+
+
diff --git a/Sources/Stim/FollowPage.xaml b/Sources/Stim/FollowPage.xaml
index 596960a..6211459 100644
--- a/Sources/Stim/FollowPage.xaml
+++ b/Sources/Stim/FollowPage.xaml
@@ -16,41 +16,21 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/Sources/Stim/FollowPage.xaml.cs b/Sources/Stim/FollowPage.xaml.cs
index e33d889..650b1c4 100644
--- a/Sources/Stim/FollowPage.xaml.cs
+++ b/Sources/Stim/FollowPage.xaml.cs
@@ -1,3 +1,5 @@
+using Model;
+
namespace Stim;
public partial class FollowPage : ContentPage
@@ -5,5 +7,11 @@ public partial class FollowPage : ContentPage
public FollowPage()
{
InitializeComponent();
+ BindingContext = (App.Current as App).Manager.CurrentUser;
+ }
+
+ public async void GoToDetail(object sender, EventArgs e)
+ {
+ await Navigation.PushAsync(new DetailledPage((sender as CollectionView).SelectedItem as Game));
}
}
\ No newline at end of file
diff --git a/Sources/Stim/MauiProgram.cs b/Sources/Stim/MauiProgram.cs
index e0e52f2..c844d22 100644
--- a/Sources/Stim/MauiProgram.cs
+++ b/Sources/Stim/MauiProgram.cs
@@ -1,4 +1,6 @@
-namespace Stim;
+using CommunityToolkit.Maui;
+
+namespace Stim;
public static class MauiProgram
{
@@ -7,6 +9,7 @@ public static class MauiProgram
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp()
+ .UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
diff --git a/Sources/Stim/Stim.csproj b/Sources/Stim/Stim.csproj
index 66813cb..6c8d998 100644
--- a/Sources/Stim/Stim.csproj
+++ b/Sources/Stim/Stim.csproj
@@ -51,6 +51,7 @@
+
@@ -76,6 +77,9 @@
+
+ MSBuild:Compile
+
MSBuild:Compile
diff --git a/Sources/Stub/Stub.csproj b/Sources/Stub/Stub.csproj
index 019ff45..f76bc03 100644
--- a/Sources/Stub/Stub.csproj
+++ b/Sources/Stub/Stub.csproj
@@ -6,6 +6,10 @@
enable
+
+
+
+
diff --git a/Sources/TestProject1/Test.csproj b/Sources/TestProject1/Test.csproj
index 17345d7..d964d8b 100644
--- a/Sources/TestProject1/Test.csproj
+++ b/Sources/TestProject1/Test.csproj
@@ -9,6 +9,7 @@
+