C# Class FFImageLoading.Forms.CachedImage

CachedImage - Xamarin.Forms image replacement with caching and downsampling capabilities
Inheritance: Xamarin.Forms.View
Show file Open project: daniel-luberda/FFImageLoading Class Usage Examples

Public Properties

Property Type Description
AspectProperty BindableProperty
BitmapOptimizationsProperty BindableProperty
CacheDurationProperty BindableProperty
CacheTypeProperty BindableProperty
DownloadStartedCommandProperty BindableProperty
DownsampleHeightProperty BindableProperty
DownsampleToViewSizeProperty BindableProperty
DownsampleUseDipUnitsProperty BindableProperty
DownsampleWidthProperty BindableProperty
ErrorCommandProperty BindableProperty
ErrorPlaceholderProperty BindableProperty
FadeAnimationEnabledProperty BindableProperty
FinishCommandProperty BindableProperty
IsLoadingProperty BindableProperty
IsLoadingPropertyKey BindablePropertyKey
IsOpaqueProperty BindableProperty
LoadingDelayProperty BindableProperty
LoadingPlaceholderProperty BindableProperty
LoadingPriorityProperty BindableProperty
RetryCountProperty BindableProperty
RetryDelayProperty BindableProperty
SourceProperty BindableProperty
SuccessCommandProperty BindableProperty
TransformPlaceholdersProperty BindableProperty
TransformationsProperty BindableProperty

Private Properties

Property Type Description
HandleTransformationsPropertyChangedDelegate void
OnDownloadStarted void
OnError void
OnFinish void
OnSizeRequest SizeRequest
OnSourcePropertyChanged void
OnSuccess void

Public Methods

Method Description
CachedImage ( ) : System
Cancel ( ) : void

Cancels image loading tasks

GetImageAsJpgAsync ( int quality = 90, int desiredWidth, int desiredHeight ) : Task

Gets the image as JPG.

GetImageAsPngAsync ( int desiredWidth, int desiredHeight ) : Task

Gets the image as PNG

InvalidateCache ( Xamarin.Forms.ImageSource source, Cache cacheType, bool removeSimilar = false ) : System.Threading.Tasks.Task

Invalidates cache for a specified image source.

InvalidateCache ( string key, Cache cacheType, bool removeSimilar = false ) : System.Threading.Tasks.Task

Invalidates cache for a specified key.

ReloadImage ( ) : void

Reloads the image.

Protected Methods

Method Description
OnBindingContextChanged ( ) : void

Private Methods

Method Description
HandleTransformationsPropertyChangedDelegate ( BindableObject bindable, object oldValue, object newValue ) : void
OnDownloadStarted ( CachedImageEvents e ) : void
OnError ( CachedImageEvents e ) : void
OnFinish ( CachedImageEvents e ) : void
OnSizeRequest ( double widthConstraint, double heightConstraint ) : SizeRequest
OnSourcePropertyChanged ( BindableObject bindable, object oldValue, object newValue ) : void
OnSuccess ( CachedImageEvents e ) : void

Method Details

CachedImage() public method

public CachedImage ( ) : System
return System

Cancel() public method

Cancels image loading tasks
public Cancel ( ) : void
return void

GetImageAsJpgAsync() public method

Gets the image as JPG.
public GetImageAsJpgAsync ( int quality = 90, int desiredWidth, int desiredHeight ) : Task
quality int
desiredWidth int
desiredHeight int
return Task

GetImageAsPngAsync() public method

Gets the image as PNG
public GetImageAsPngAsync ( int desiredWidth, int desiredHeight ) : Task
desiredWidth int
desiredHeight int
return Task

InvalidateCache() public static method

Invalidates cache for a specified image source.
public static InvalidateCache ( Xamarin.Forms.ImageSource source, Cache cacheType, bool removeSimilar = false ) : System.Threading.Tasks.Task
source Xamarin.Forms.ImageSource Image source.
cacheType Cache Cache type.
removeSimilar bool If set to true removes all image cache variants /// (downsampling and transformations variants)
return System.Threading.Tasks.Task

InvalidateCache() public static method

Invalidates cache for a specified key.
public static InvalidateCache ( string key, Cache cacheType, bool removeSimilar = false ) : System.Threading.Tasks.Task
key string
cacheType Cache Cache type.
removeSimilar bool If set to true removes all image cache variants /// (downsampling and transformations variants)
return System.Threading.Tasks.Task

OnBindingContextChanged() protected method

protected OnBindingContextChanged ( ) : void
return void

ReloadImage() public method

Reloads the image.
public ReloadImage ( ) : void
return void

Property Details

AspectProperty public static property

The aspect property.
public static BindableProperty AspectProperty
return BindableProperty

BitmapOptimizationsProperty public static property

The bitmap optimizations property.
public static BindableProperty BitmapOptimizationsProperty
return BindableProperty

CacheDurationProperty public static property

The cache duration property.
public static BindableProperty CacheDurationProperty
return BindableProperty

CacheTypeProperty public static property

The cache type property.
public static BindableProperty CacheTypeProperty
return BindableProperty

DownloadStartedCommandProperty public static property

The DownloadStartedCommandProperty.
public static BindableProperty DownloadStartedCommandProperty
return BindableProperty

DownsampleHeightProperty public static property

The downsample height property.
public static BindableProperty DownsampleHeightProperty
return BindableProperty

DownsampleToViewSizeProperty public static property

The downsample to view size property.
public static BindableProperty DownsampleToViewSizeProperty
return BindableProperty

DownsampleUseDipUnitsProperty public static property

The downsample use dip units property.
public static BindableProperty DownsampleUseDipUnitsProperty
return BindableProperty

DownsampleWidthProperty public static property

The downsample width property.
public static BindableProperty DownsampleWidthProperty
return BindableProperty

ErrorCommandProperty public static property

The ErrorCommandProperty.
public static BindableProperty ErrorCommandProperty
return BindableProperty

ErrorPlaceholderProperty public static property

The error placeholder property.
public static BindableProperty ErrorPlaceholderProperty
return BindableProperty

FadeAnimationEnabledProperty public static property

The fade animation enabled property.
public static BindableProperty FadeAnimationEnabledProperty
return BindableProperty

FinishCommandProperty public static property

The FinishCommandProperty.
public static BindableProperty FinishCommandProperty
return BindableProperty

IsLoadingProperty public static property

The is loading property.
public static BindableProperty IsLoadingProperty
return BindableProperty

IsLoadingPropertyKey public static property

The is loading property key.
public static BindablePropertyKey IsLoadingPropertyKey
return BindablePropertyKey

IsOpaqueProperty public static property

The is opaque property.
public static BindableProperty IsOpaqueProperty
return BindableProperty

LoadingDelayProperty public static property

The loading delay property.
public static BindableProperty LoadingDelayProperty
return BindableProperty

LoadingPlaceholderProperty public static property

The loading placeholder property.
public static BindableProperty LoadingPlaceholderProperty
return BindableProperty

LoadingPriorityProperty public static property

The loading priority property.
public static BindableProperty LoadingPriorityProperty
return BindableProperty

RetryCountProperty public static property

The retry count property.
public static BindableProperty RetryCountProperty
return BindableProperty

RetryDelayProperty public static property

The retry delay property.
public static BindableProperty RetryDelayProperty
return BindableProperty

SourceProperty public static property

The source property.
public static BindableProperty SourceProperty
return BindableProperty

SuccessCommandProperty public static property

The SuccessCommandProperty.
public static BindableProperty SuccessCommandProperty
return BindableProperty

TransformPlaceholdersProperty public static property

The TransformPlaceholders property.
public static BindableProperty TransformPlaceholdersProperty
return BindableProperty

TransformationsProperty public static property

The transformations property.
public static BindableProperty TransformationsProperty
return BindableProperty