From ff540c6f0c9a802bf03de432043ff2b5a4c38aa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Erbsh=C3=A4u=C3=9Fer?= Date: Fri, 1 Jan 2021 18:41:16 +0100 Subject: [PATCH] Moved recently opened file location to app data. --- ucalc/App.xaml.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ucalc/App.xaml.cs b/ucalc/App.xaml.cs index 616fa75..d1a7db1 100644 --- a/ucalc/App.xaml.cs +++ b/ucalc/App.xaml.cs @@ -1,4 +1,6 @@ -using UCalc.Data; +using System; +using System.IO; +using UCalc.Data; namespace UCalc { @@ -9,7 +11,10 @@ namespace UCalc public App() { - _recentlyOpenedList = new RecentlyOpenedList("recently.txt"); + var appDataPath = $"{Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)}/UCalc"; + Directory.CreateDirectory(appDataPath); + + _recentlyOpenedList = new RecentlyOpenedList($"{appDataPath}/recently.txt"); } } } \ No newline at end of file