我在 XAML 中有一个列表框,我正在用这个 litbox 输入一些数据。如下所示
lstsumitedreport = new ObservableCollection<ClsGetSubmittedReport>();
if (ResultCode == "1")
{
JArray arry = (JArray)obj["GetSubmittedReportComment"];
if (arry != null)
{
total = arry.Count;
for (int i = 0; i < arry.Count; i++)
{
JObject obj1 = (JObject)arry[i];
int reportId = (int)obj1["ReportId"];
string positiveCmnt = (string)obj1["PositiveComment"];
string NagativeCmnt = (string)obj1["negativecomment"];
DateTime dt = (DateTime)obj1["TimeStamp"];
string time = (string)obj1["TimeStampString"];
DateTime dtlocal = DateTime.ParseExact(time, "yyyy/MM/dd HH:mm:ss", CultureInfo.InvariantCulture);
string timestamp = dtlocal.ToString("MM/dd/yyyy hh:mm tt", CultureInfo.InvariantCulture);
lstsumitedreport.Add(new ClsGetSubmittedReport(reportId, positiveCmnt, NagativeCmnt, timestamp, Csi, goodimagepath, bedimagepath, goodimgline, bedimgline, font, PHeight, NHeight));
}
}
TransactionList.ItemsSource = null;
this.TransactionList.ItemsSource = lstsumitedreport;
tbOutstandingCount.Text = total.ToString();
}
这里的横断列表是我的列表框名称。调试波纹管后,显示数据需要很长时间。
this.TransactionList.ItemsSource = lstsumitedreport;
我该如何解决这个问题