fix : j'avais peut être cassé le programme
continuous-integration/drone/push Build is failing Details

Popup_qui_marche_pas
Jade VAN BRABANDT 2 years ago
parent eeb1b8054b
commit ceee48974d

@ -29,7 +29,7 @@ namespace StimPersistance
throw new NotImplementedException();
}
public ObservableCollection<Game>? LoadGame()
public ObservableCollection<Game> LoadGame()
{
if (File.Exists("games.xml"))
{

@ -4,12 +4,12 @@ namespace Model
{
public class Manager
{
public IPersistance persistance;
public IPersistance Mgrpersistance;
public ObservableCollection<Game> GameList { get;}
public Manager(IPersistance persistance)
{
persistance = persistance;
Mgrpersistance = persistance;
GameList = persistance.LoadGame();
if (GameList == null) { GameList = new ObservableCollection<Game>();}
}
@ -17,13 +17,13 @@ namespace Model
public void AddGametoGamesList(Game game)
{
GameList.Add(game);
persistance.SaveGame(GameList);
Mgrpersistance.SaveGame(GameList);
}
public void RemoveGameFromGamesList(Game game)
{
GameList.Remove(game);
persistance.SaveGame(GameList);
Mgrpersistance.SaveGame(GameList);
}
/*public void LoadGames()
@ -32,7 +32,7 @@ namespace Model
}*/
public void SaveGames()
{
persistance.SaveGame(GameList);
Mgrpersistance.SaveGame(GameList);
}
}
}

@ -23,11 +23,13 @@ public partial class AddGamePage : ContentPage
//System.IO.File.Copy(_ImgPath, /**/, true);
((App)App.Current).Manager.AddGametoGamesList(new Game(NameEntry.Text, DescriptionEntry.Text, year, new List<string> { TagEntry1.Text, TagEntry2.Text, TagEntry3.Text }, imgName, LinkEntry.Text));
Navigation.RemovePage(this);
((App)App.Current).Manager.SaveGames();
}
private async void Button_Clicked(object sender, EventArgs e)
{
var ImgTask = await FilePicker.Default.PickAsync(null);
if (ImgTask == null) return;
_ImgPath = ImgTask.FullPath;
}
}

@ -20,7 +20,7 @@ public partial class App : Application
window.Stopped += (s, e) =>
{
Manager.persistance = new Persistance(FileSystem.Current.AppDataDirectory);
Manager.Mgrpersistance = new Persistance(FileSystem.Current.AppDataDirectory);
var test = Manager;
Manager.SaveGames();
};

@ -12,7 +12,6 @@ public partial class DetailledPage : ContentPage
avgLabel.Text = game.Average.ToString();
AddStars(starsContainer, game.Average);
var test = game.Lien;
}
private void AddStars(object sender, EventArgs e)

Loading…
Cancel
Save