c# - 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)
解决方案
推荐阅读
- curl - 如何使用 GitLab API 列出子组的项目?
- r - R错误“条件长度> 1,仅使用第一个元素”
- c# - 从类型对象创建数组
- vim - 在neovim中将自动缩进设置为空格?
- javascript - Create-React-App 测试和 Jest Mocking
- javascript - 无法弄清楚为什么我的文字没有变成绿色
- docker - 在 Nginx 代理后面时,Keycloak Docker Instace 中的 X-Frame-Options 拒绝加载
- python - Python读取文件时使用什么内存资源
- python - Keras/tensorflow:无法从损失函数调用 tf.Print()
- vb.net - Process() 中程序文件 (86) 路径的正确 Visual Basic 引用