From 472cb85796d3527e91cd98586e138c6d9f2c1448 Mon Sep 17 00:00:00 2001 From: "jules.lascret" Date: Thu, 6 Jun 2024 16:55:35 +0200 Subject: [PATCH] Fix path issue --- Qwirkle/QwirkleViews/App.xaml.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Qwirkle/QwirkleViews/App.xaml.cs b/Qwirkle/QwirkleViews/App.xaml.cs index 5a8252b..94d9aab 100644 --- a/Qwirkle/QwirkleViews/App.xaml.cs +++ b/Qwirkle/QwirkleViews/App.xaml.cs @@ -12,7 +12,9 @@ namespace Qwirkle { public App() { - Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\..\\Files")); + string appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); + string targetPath = Path.Combine(appDataPath, "Programs", "Files"); + Directory.SetCurrentDirectory(targetPath); InitializeComponent(); MainPage = new AppShell(); @@ -24,6 +26,7 @@ namespace Qwirkle Routing.RegisterRoute(nameof(Qwirkle.Pages.Leaderboard), typeof(Qwirkle.Pages.Leaderboard)); ILeaderboardPersistence leaderboardLoad = new LeaderboardPersistenceJson(); + Ld = leaderboardLoad.LoadLeaderboard(); }