Skip to content

Commit

Permalink
chore: move property definition
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed Oct 25, 2024
1 parent 829456e commit 0cd2e49
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/Uno.UI/UI/Xaml/Media/ImageSource.crossruntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ internal IDisposable Subscribe(Action<ImageData> onSourceOpened)
return Disposable.Create(() => _subscriptions.Remove(onSourceOpened));
}

/// <summary>
/// Indicates that this source has already been opened
/// (So the onSourceOpened callback of Subscribe will be invoked synchronously!)
/// </summary>
internal bool IsOpened => _imageData.HasData;

private protected void InvalidateSource()
{
_imageData = default;
Expand Down
5 changes: 0 additions & 5 deletions src/Uno.UI/UI/Xaml/Media/ImageSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,6 @@ private set
}
}

/// <summary>
/// Indicates that this source has already been opened
/// (So the onSourceOpened callback of Subscribe will be invoked synchronously!)
/// </summary>
internal bool IsOpened => _imageData.HasData;
partial void SetImageLoader();

internal void UnloadImageData()
Expand Down
5 changes: 5 additions & 0 deletions src/Uno.UI/UI/Xaml/Media/ImageSource.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public static NSUrlSession DefaultSession

static public implicit operator ImageSource(UIImage image) => new ImageSource(image);

/// <summary>
/// Indicates that this source has already been opened (So TryOpenSync will return true!)
/// </summary>
internal bool IsOpened => _imageData.HasData;

private static UIImage? OpenBundleFromString(string? bundle)
{
if (!bundle.IsNullOrWhiteSpace())
Expand Down

0 comments on commit 0cd2e49

Please sign in to comment.