Uno Error in WhileLoading

I am using some code based on 500px Mobile App that has been made by fuse everything was working just fine until I upgraded to the latest version of fuse, and when I tried to run my app in preview again I have got this error “Fuse.Triggers.WhileLoading does not contain a member called SetState, Could you be missing a package reference”

and here is sample code:

public class ImgView: Element
{
HttpImageSource _source = new HttpImageSource();

    public ImageSource Source
    {
            get { return _source; }
            set
            {
                    _source = value as HttpImageSource;
            }
    }

    public String ImageUrl
    {
            get { return _source.Url; }
            set
            {
                    _source.Url = value;
                    if (value == "" || value == null)
                    {
                            // Cleanup state triggers
                            WhileLoaded.SetState(this, false);
                            WhileFailed.SetState(this, false, "");
                            WhileLoading.SetState(this, false);
                    }
                    else
                    {
                            // Check if image is already available
                            WhileCacheLoaded.SetState(this, _source.State == ImageSourceState.Ready);
                    }
            }
    }

    public MemoryPolicy ImageMemoryPolicy
    {
            get { return _source.Policy; }
            set { if (_source.Policy != value) _source.Policy = value; }
    }

    protected override void OnRooted()
    {
            base.OnRooted();
            _source.Changed += OnSourceChanged;
    }

    protected override void OnUnrooted()
    {
            _source.Changed -= OnSourceChanged;
            _source.Url = null; // abort pending Http request
            base.OnUnrooted();
    }

    protected override VisualBounds CalcRenderBounds()
    {
            return base.CalcRenderBounds().AddRect(float2(0), ActualSize);
    }

    void OnSourceChanged(object Source, object Args)
    {
            if (_source.State == ImageSourceState.Ready) UpdateManager.AddDeferredAction(InvalidateVisual);
            WhileLoaded.SetState(this, _source.State == ImageSourceState.Ready);
            WhileFailed.SetState(this, _source.State == ImageSourceState.Failed, "Image loading error");
            WhileLoading.SetState(this, _source.State == ImageSourceState.Loading);
    }

    protected override void OnDraw(DrawContext dc)
    {
            texture2D tex = _source.GetTexture();
            if (tex != null)
                    draw
                    {
                            apply Fuse.Drawing.Planar.Image;
                            DrawContext: dc;
                            Visual: this;
                            Size: ActualSize;
                            Texture: tex;
                            BlendEnabled: false;
                            DepthTestEnabled: false;
                    };
    }

}

Why are you using this custom code to handle image loading?

The loading mechanims has been merged into the busy mechanism now, so WhileLoading.SetState doesn’t exist. You must instead set the busy status. Create a BusyTask property in your class, such as BusyTask _loadingTask. Then to mark the node busy call:

BusyTask.SetBusy(this, ref _loadingTask, BusyTaskActivity.Loading);

To mark is as not loading:

BusyTask.SetBusy(this, ref _loadingTask, BusyTaskActivity.None);

Though consider not using this custom Uno code, as the interfaces to Busy and loading will likely change again. Plus, hopefully there is no need for the custom code now.

500px Mobile App that has been made by fuse

Just to clarify: Fuse has not made any such app. If you found the source for one, it’s made by someone in the community, and is not an official Fuse app/source.