mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-09 08:25:10 +00:00
Version 4.12.2 Fixed local file handling for UWP. All relative paths relative to ms-appx:
This commit is contained in:
parent
26bf0b5005
commit
c28387f87c
14 changed files with 172 additions and 192 deletions
|
|
@ -11,18 +11,18 @@ namespace MapControl
|
|||
{
|
||||
public partial class Tile
|
||||
{
|
||||
public void SetImage(ImageSource imageSource, bool fadeIn = true)
|
||||
public void SetImage(ImageSource image, bool fadeIn = true)
|
||||
{
|
||||
Pending = false;
|
||||
|
||||
if (fadeIn && FadeDuration > TimeSpan.Zero)
|
||||
{
|
||||
var bitmapSource = imageSource as BitmapSource;
|
||||
var bitmap = image as BitmapSource;
|
||||
|
||||
if (bitmapSource != null && !bitmapSource.IsFrozen && bitmapSource.IsDownloading)
|
||||
if (bitmap != null && !bitmap.IsFrozen && bitmap.IsDownloading)
|
||||
{
|
||||
bitmapSource.DownloadCompleted += BitmapDownloadCompleted;
|
||||
bitmapSource.DownloadFailed += BitmapDownloadFailed;
|
||||
bitmap.DownloadCompleted += BitmapDownloadCompleted;
|
||||
bitmap.DownloadFailed += BitmapDownloadFailed;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -34,25 +34,25 @@ namespace MapControl
|
|||
Image.Opacity = 1d;
|
||||
}
|
||||
|
||||
Image.Source = imageSource;
|
||||
Image.Source = image;
|
||||
}
|
||||
|
||||
private void BitmapDownloadCompleted(object sender, EventArgs e)
|
||||
{
|
||||
var bitmapSource = (BitmapSource)sender;
|
||||
var bitmap = (BitmapSource)sender;
|
||||
|
||||
bitmapSource.DownloadCompleted -= BitmapDownloadCompleted;
|
||||
bitmapSource.DownloadFailed -= BitmapDownloadFailed;
|
||||
bitmap.DownloadCompleted -= BitmapDownloadCompleted;
|
||||
bitmap.DownloadFailed -= BitmapDownloadFailed;
|
||||
|
||||
FadeIn();
|
||||
}
|
||||
|
||||
private void BitmapDownloadFailed(object sender, ExceptionEventArgs e)
|
||||
{
|
||||
var bitmapSource = (BitmapSource)sender;
|
||||
var bitmap = (BitmapSource)sender;
|
||||
|
||||
bitmapSource.DownloadCompleted -= BitmapDownloadCompleted;
|
||||
bitmapSource.DownloadFailed -= BitmapDownloadFailed;
|
||||
bitmap.DownloadCompleted -= BitmapDownloadCompleted;
|
||||
bitmap.DownloadFailed -= BitmapDownloadFailed;
|
||||
|
||||
Image.Source = null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue