diff --git a/Sources/Stim/AddGamePage.xaml.cs b/Sources/Stim/AddGamePage.xaml.cs new file mode 100644 index 0000000..63170f1 --- /dev/null +++ b/Sources/Stim/AddGamePage.xaml.cs @@ -0,0 +1,22 @@ +using Model; + +namespace Stim; + +public partial class AddGamePage : ContentPage +{ + public Manager Manager { get; set; } + public AddGamePage(Manager Mgr) + { + InitializeComponent(); + Manager = Mgr; + } + + private void AddGame(object sender, EventArgs e) + { + //faut rajouter des tests + string tag1 = TagEntry1.Text; + string tag2 = TagEntry2.Text; + string tag3 = TagEntry3.Text; + Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, int.Parse(YearEntry.Text), new List { tag1, tag2, tag3 }, "null")); + } +} \ No newline at end of file diff --git a/Sources/Stim/MainPage.xaml.cs b/Sources/Stim/MainPage.xaml.cs index a670ecb..8383a66 100644 --- a/Sources/Stim/MainPage.xaml.cs +++ b/Sources/Stim/MainPage.xaml.cs @@ -19,4 +19,9 @@ public partial class MainPage : ContentPage { await Navigation.PushAsync(new DetailledPage((sender as CollectionView).SelectedItem as Game)); } + + private async void GoToAddGamePage(object sender, EventArgs e) + { + await Navigation.PushAsync(new AddGamePage(Manager)); + } } diff --git a/Sources/Stim/Stim.csproj b/Sources/Stim/Stim.csproj index 01c1343..d5286c8 100644 --- a/Sources/Stim/Stim.csproj +++ b/Sources/Stim/Stim.csproj @@ -57,6 +57,9 @@ + + MSBuild:Compile + MSBuild:Compile diff --git a/Sources/Stub/Stub.cs b/Sources/Stub/Stub.cs index 87bc8ea..0a51941 100644 --- a/Sources/Stub/Stub.cs +++ b/Sources/Stub/Stub.cs @@ -1,13 +1,12 @@ using Model; using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using System.Xml; namespace StimStub { public class Stub : IPersistance { public readonly ObservableCollection games = new(); + public Stub() { SaveGame(games);