mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-04 14:08:32 +00:00
Removed cache cleaning from MainWindow
This commit is contained in:
parent
cdb7d4af15
commit
2f3c704fd7
2 changed files with 13 additions and 29 deletions
|
|
@ -1,5 +1,4 @@
|
|||
using MapControl;
|
||||
using MapControl.Caching;
|
||||
using MapControl.UiTools;
|
||||
using Microsoft.UI;
|
||||
using Microsoft.UI.Input;
|
||||
|
|
@ -11,7 +10,6 @@ using System.Diagnostics;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.System;
|
||||
|
||||
namespace SampleApplication
|
||||
|
|
@ -20,9 +18,14 @@ namespace SampleApplication
|
|||
{
|
||||
static MainWindow()
|
||||
{
|
||||
//TileImageLoader.Cache = new ImageFileCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new FileDbCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new SQLiteCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new MapControl.Caching.ImageFileCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new MapControl.Caching.FileDbCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new MapControl.Caching.SQLiteCache(TileImageLoader.DefaultCacheFolder);
|
||||
//TileImageLoader.Cache = new RedisCache(Options.Create(new RedisCacheOptions
|
||||
//{
|
||||
// Configuration = "localhost:6379",
|
||||
// InstanceName = "MapTileCache/"
|
||||
//}));
|
||||
|
||||
var bingMapsApiKeyPath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "MapControl", "BingMapsApiKey.txt");
|
||||
|
|
@ -80,23 +83,10 @@ namespace SampleApplication
|
|||
}
|
||||
|
||||
AddTestLayers();
|
||||
|
||||
if (TileImageLoader.Cache is ImageFileCache)
|
||||
{
|
||||
Activated += WindowActivated;
|
||||
}
|
||||
}
|
||||
|
||||
partial void AddTestLayers();
|
||||
|
||||
private async void WindowActivated(object sender, WindowActivatedEventArgs e)
|
||||
{
|
||||
Activated -= WindowActivated;
|
||||
|
||||
await Task.Delay(2000);
|
||||
await ((ImageFileCache)TileImageLoader.Cache).CleanAsync();
|
||||
}
|
||||
|
||||
private void ResetHeadingButtonClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
map.TargetHeading = 0d;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue