首页 > 解决方案 > API 等待 Fetch 忽略 FlowListView Setter

问题描述

设置我的 Flowlist 的代码被忽略,但仅在页面打开的第一个实例上。

    protected override async void OnAppearing()
        {
                    WCObject WooObject = new WCObject(rest);
                    //This Runs Fine 
                    var Tags = await WooObject.Tag.GetAll(new Dictionary<string, string>() {
                    { "per_page", "100" } });
                    //This Doesnt Run
                    Taglistview.FlowItemsSource = Tags;
                    //Runs fine after you Reopen the page 
        }

我的初始化任务的结果相同。我正在尝试了解 Async 和 await 以及在哪里使用它,但这超出了我的想象。我认为它在等待 Get all Thread to Finish 但是为什么呢?没有等待()

这是堆栈跟踪,它是唯一发生的错误

RestAPI.SendHttpClientRequest[T] (System.String endpoint, WooCommerceNET.RequestMethod method, T requestBody, System.Collections.Generic.Dictionary`2[TKey,TValue] parms)
System.Net.WebException: System.Net.WebException
WooCommerceNET
RestAPI.SendHttpClientRequest[T] (System.String endpoint, WooCommerceNET.RequestMethod method, T requestBody, System.Collections.Generic.Dictionary`2[TKey,TValue] parms)
WooCommerceNET
RestAPI.GetRestful (System.String endpoint, System.Collections.Generic.Dictionary`2[TKey,TValue] parms)
WooCommerceNET.Base
WCItem`1[T].GetAll (System.Collections.Generic.Dictionary`2[TKey,TValue] parms)

标签: c#xamarin.forms

解决方案


推荐阅读