diff --git a/Sources/Stim.Model/Manager.cs b/Sources/Stim.Model/Manager.cs index 8151826..13388c6 100644 --- a/Sources/Stim.Model/Manager.cs +++ b/Sources/Stim.Model/Manager.cs @@ -4,21 +4,25 @@ namespace Model { public class Manager { + public IPersistance _persistance; public ObservableCollection GameList { get;} public Manager(IPersistance persistance) - { + { + _persistance = persistance; GameList = persistance.LoadGame(); } public void AddGametoGamesList(Game game) { GameList.Add(game); + _persistance.SaveGame(GameList); } public void RemoveGameFromGamesList(Game game) { GameList.Remove(game); + _persistance.SaveGame(GameList); } } } diff --git a/Sources/Stim/DetailledPage.xaml.cs b/Sources/Stim/DetailledPage.xaml.cs index 92d9a55..ef8ad17 100644 --- a/Sources/Stim/DetailledPage.xaml.cs +++ b/Sources/Stim/DetailledPage.xaml.cs @@ -21,14 +21,14 @@ public partial class DetailledPage : ContentPage AddStars(layout, rev.Rate); } - private void AddStars(HorizontalStackLayout container, float rate) + private static void AddStars(HorizontalStackLayout container, float rate) { for (int i = 0; i < (int)rate; i++) container.Children.Add(new Image { Source = "etoile_pleine.png", WidthRequest = 30 }); if ((int)rate != rate) container.Children.Add(new Image { Source = "etoile_mi_pleine.png", WidthRequest = 30 }); while (container.Children.Count != 6) container.Children.Add(new Image { Source = "etoile_vide.png", WidthRequest = 30 }); } - private async void goToMainPage(object sender, EventArgs e) + private async void GoToMainPage(object sender, EventArgs e) { await Navigation.PushModalAsync(new MainPage()); } diff --git a/Sources/Stim/MainPage.xaml b/Sources/Stim/MainPage.xaml index 79b4863..d63e5ba 100644 --- a/Sources/Stim/MainPage.xaml +++ b/Sources/Stim/MainPage.xaml @@ -4,63 +4,84 @@ x:Class="Stim.MainPage" Title="Accueil" Background="{StaticResource Secondary}"> - - - - - - - - + + + + + + + + + + + - - - + + + + - - - - + + + + + + + + + - - - - - - - - - - + + + + - - - - - - - + + + + + - - + + + - - - - - - - - + + + + + + + + diff --git a/Sources/Stim/MainPage.xaml.cs b/Sources/Stim/MainPage.xaml.cs index 0ff7e2e..a670ecb 100644 --- a/Sources/Stim/MainPage.xaml.cs +++ b/Sources/Stim/MainPage.xaml.cs @@ -1,6 +1,7 @@ namespace Stim; using Model; using StimPersistance; +using StimStub; public partial class MainPage : ContentPage { @@ -18,9 +19,4 @@ public partial class MainPage : ContentPage { await Navigation.PushAsync(new DetailledPage((sender as CollectionView).SelectedItem as Game)); } - - private async void goToMainPage(object sender, EventArgs e) - { - await Navigation.PushAsync(new MainPage()); - } } diff --git a/Sources/Stim/Resources/Images/add_black.png b/Sources/Stim/Resources/Images/add_black.png new file mode 100644 index 0000000..2488823 Binary files /dev/null and b/Sources/Stim/Resources/Images/add_black.png differ diff --git a/Sources/Stim/Resources/Images/add_white.png b/Sources/Stim/Resources/Images/add_white.png new file mode 100644 index 0000000..d56c133 Binary files /dev/null and b/Sources/Stim/Resources/Images/add_white.png differ diff --git a/Sources/Stim/Resources/Styles/Styles.xaml b/Sources/Stim/Resources/Styles/Styles.xaml index 4af4da7..94b01aa 100644 --- a/Sources/Stim/Resources/Styles/Styles.xaml +++ b/Sources/Stim/Resources/Styles/Styles.xaml @@ -14,7 +14,7 @@ @@ -24,10 +24,10 @@