【发布时间】:2020-10-28 07:34:03
【问题描述】:
我的应用程序从 Firebase 后端检索数据。检索数据并将其放入列表对象中
列表类型及其变量
public class UserLogs
{
public Guid UserID { get; set; }
public string logData { get; set; }
public string sliderValue { get; set; }
public string logTime { get; set; }
}
}
List<UserLogs> foundLogs = new List<UserLogs>();
从 firebase 获取所需数据
foundLogs = (await firebaseClient
.Child("UserLogs")
.OnceAsync<UserLogs>()).Where(a => a.Object.UserID == userID).Select(item => new UserLogs
{
UserID = item.Object.UserID,
logData = item.Object.logData,
sliderValue = item.Object.sliderValue,
logTime = item.Object.logTime
}).ToList();
当尝试将此列表显示到列表视图时,它将显示为对象名称,例如
如何在列表视图中显示列表的每个索引处的数据?例如,如果我想在变量监视窗口中显示 UserID 或 logData,我该怎么做?
我当前如何显示列表
//list of logs being the name of the list view in the xaml file
ListOfLogs.ItemsSource = foundLogs;
提前谢谢你
【问题讨论】:
标签: c# firebase xamarin xamarin.forms