Xamarin.Forms Guides | Samples

Xamarin.Forms.Image Class

View that holds an image.

See Also: Image


public class Image : View, IElementConfiguration<Image>, IImageController


The following example creates a new image from a file

C# Example

var image = new Image { Source = "picture.png" };

The FormsGallery sample, which can be found on the Sample Applications page, has a ImageDemoPage.cs file. This file contains a longer and more complicated example.


Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions:,,,,,,

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

See Also: View

Public Constructors

Initializes a new instance of the Image class.

Public Fields

static readonly
AspectPropertyBindableProperty. Identifies the Aspect bindable property.
static readonly
IsLoadingPropertyBindableProperty. Identifies the IsLoading bindable property.
static readonly
IsOpaquePropertyBindableProperty. Identifies the IsOpaque bindable property.
static readonly
SourcePropertyBindableProperty. Identifies the Source bindable property.

Public Properties

AspectAspect. Gets or sets the scaling mode for the image. This is a bindable property.
IsLoadingBoolean. Gets the loading status of the image. This is a bindable property.
IsOpaqueBoolean. Gets or sets the opacity flag for the image. This is a bindable property.
SourceImageSource. Gets or sets the source of the image. This is a bindable property.

Public Methods

On<T>() : IPlatformElementConfiguration<T, Image>
Returns the platform-specific instance of this Image, on which a platform-specific method may be called.

Protected Methods

Invoked when the BindingContext changes.
Invoked when a property has changed.
Invoked when a property will change.
OnSizeRequest(Double, Double) : SizeRequest
Invoked when the layotu cycle request the element desired size.

Explicitly Implemented Interface Members