From 8ddb5e595e922479a0ace8bb30600519bdd1a65e Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sat, 22 Feb 2025 16:07:49 +0100 Subject: [PATCH] Update MainWindow.xaml.cs --- SampleApps/WpfApplication/MainWindow.xaml.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SampleApps/WpfApplication/MainWindow.xaml.cs b/SampleApps/WpfApplication/MainWindow.xaml.cs index fe1928b8..2c692565 100644 --- a/SampleApps/WpfApplication/MainWindow.xaml.cs +++ b/SampleApps/WpfApplication/MainWindow.xaml.cs @@ -11,19 +11,20 @@ namespace SampleApplication { public partial class MainWindow : Window { - static MainWindow() + public MainWindow() { //MapProjectionFactory.Instance = new MapControl.Projections.GeoApiProjectionFactory(); //TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new MapControl.Caching.FileDbCache(TileImageLoader.DefaultCacheFolder); //TileImageLoader.Cache = new MapControl.Caching.SQLiteCache(TileImageLoader.DefaultCacheFolder); + + // https://neosmart.net/blog/sqlite-cache-for-asp-net-core/ //TileImageLoader.Cache = new NeoSmart.Caching.Sqlite.SqliteCache( // new NeoSmart.Caching.Sqlite.SqliteCacheOptions { CachePath = System.IO.Path.Combine(TileImageLoader.DefaultCacheFolder, "TileCache.db") }); - } - public MainWindow() - { + //Closed += (s, e) => (TileImageLoader.Cache as IDisposable)?.Dispose(); + InitializeComponent(); AddTestLayers(); }