Skip to content

Commit

Permalink
Fixes #749 - System.NotImplementedException when trying to call Prelo…
Browse files Browse the repository at this point in the history
…adAsync
  • Loading branch information
daniel-luberda committed Oct 2, 2017
1 parent f90b5da commit d2b8ad5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
8 changes: 4 additions & 4 deletions source/FFImageLoading.Common/Work/Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
namespace FFImageLoading.Work
{
public class Target<TImageContainer, TImageView>: ITarget<TImageContainer, TImageView>
{
public virtual TImageView Control { get { throw new NotImplementedException(); }}
{
public virtual TImageView Control => default(TImageView);

public virtual bool IsValid { get; } = true;
public virtual bool IsValid { get; } = true;

public virtual bool IsTaskValid(IImageLoaderTask task) => IsValid;

public virtual bool UsesSameNativeControl(IImageLoaderTask task) => false;
public virtual bool UsesSameNativeControl(IImageLoaderTask task) => false;

public virtual void SetAsEmpty(IImageLoaderTask task) { }

Expand Down
20 changes: 19 additions & 1 deletion source/FFImageLoading.Common/Work/TaskParameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,25 @@ public static TaskParameter FromString(string data, DataEncodingType encoding)
/// <value>The delay in milliseconds.</value>
public int? DelayInMs { get; private set; }

public bool Preload { get; internal set; }
bool preload;
public bool Preload
{
get
{
return preload;
}

internal set
{
preload = value;

if (value)
{
FadeAnimationEnabled = false;
FadeAnimationForCachedImagesEnabled = false;
}
}
}

public TaskParameter Transform(ITransformation transformation)
{
Expand Down

0 comments on commit d2b8ad5

Please sign in to comment.