Skip to content

Commit

Permalink
Tidying up
Browse files Browse the repository at this point in the history
  • Loading branch information
mstefarov committed Sep 11, 2023
1 parent 7462602 commit e3d4fd9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Toolkit/Toolkit/UI/Controls/PopupViewer/PopupMediaView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ private void OnPopupMediaPropertyChanged()
// Also used for embedded images in TextPopupElement views
internal static bool TryCreateImageSource(string? sourceUri, out ImageSource? source)
{
source = null;
if (sourceUri != null && sourceUri.StartsWith("data:image/"))
{
// might be base64
Expand All @@ -223,7 +222,7 @@ internal static bool TryCreateImageSource(string? sourceUri, out ImageSource? so
var base64data = sourceUri.Substring(idx + 8);
var data = Convert.FromBase64String(base64data);
#if MAUI
var newSource = new StreamImageSource() { Stream = (token) => Task.FromResult<Stream>(new MemoryStream(data)) };
var newSource = new StreamImageSource { Stream = (token) => Task.FromResult<Stream>(new MemoryStream(data)) };
#else
var newSource = new BitmapImage();
newSource.BeginInit();
Expand All @@ -245,6 +244,7 @@ internal static bool TryCreateImageSource(string? sourceUri, out ImageSource? so
#endif
return true;
}
source = null;
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
using Esri.ArcGISRuntime.Mapping.Popups;
using Esri.ArcGISRuntime.Toolkit.Internal;
using Microsoft.Maui.ApplicationModel;
using Esri.ArcGISRuntime.UI;
using Grid = Microsoft.Maui.Controls.Grid;
using RuntimeImageExtensions = Esri.ArcGISRuntime.Maui.RuntimeImageExtensions;

namespace Esri.ArcGISRuntime.Toolkit.Maui.Primitives
{
Expand Down

0 comments on commit e3d4fd9

Please sign in to comment.