Xamarin.Forms Guides | Samples

Xamarin.Forms.ImageSource Class

Abstract class whose implementors load images from files or the Web.

See Also: ImageSource

Syntax

[Xamarin.Forms.TypeConverter(typeof(Xamarin.Forms.ImageSourceConverter))]
public abstract class ImageSource : Element

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.ImageSource are listed below.

See Also: Element

Protected Constructors

Creates a new ImageSource with default values.

Protected Properties

[read-only]
CancellationTokenSourceCancellationTokenSource. Gets the CancellationTokenSource.

Public Methods

Cancel() : System.Threading.Tasks.Task<bool>
Request a cancel of the ImageSource loading.
static
FromFile(String) : ImageSource
Returns a new FileImageSource that reads from file.
static
FromResource(String) : ImageSource
Creates an ImageSource for an EmbeddedResource included in the Assembly from which the call to FromResource is made.
static
FromResource(String, Assembly) : ImageSource
Creates a ImageSource from the specified resource in the specified source assembly.
static
FromResource(String, Type) : ImageSource
Creates a ImageSource from the specified resource in the specified source assembly.
static
FromStream(Func<System.IO.Stream>) : ImageSource
Returns a new StreamImageSource that reads from stream.
static
FromUri(Uri) : ImageSource
Returns a new UriImageSource that reads from uri.

Protected Methods

OnLoadingCompleted(Boolean)
Called by inheritors to indicate the end of the loading of the source.
OnLoadingStarted()
Called by inheritors to indicate the beginning of a loading operation.
OnSourceChanged()
Called by inheritors to indicate that the source changed..

Public Operators

static
Conversion to Xamarin.Forms.ImageSource(Implicit)Allows implicit casting from a string that represents an absolute URI.
static
Conversion to Xamarin.Forms.ImageSource(Implicit)Allows implicit casting from Uri objects that were created with an absolute URI.

Explicitly Implemented Interface Members

ImageSource$IElement.ParentElement. Gets or sets the element to which this ImageSource object belongs.
ImageSource$IElement.XamlParentWeakReference<Element>. Gets or sets a weak reference to the parent of this ImageSource object.