mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-10 19:46:08 +08:00
fix: 修复显示对象
This commit is contained in:
@@ -32,21 +32,21 @@ namespace CRSim.ScreenSimulator.ViewModels.Zibo
|
||||
LeftScreen.Clear();
|
||||
RightScreen.Clear();
|
||||
int startIndex = CurrentPageIndex * ItemsPerPage * PageCount;
|
||||
var leftItems = TrainInfo.Skip(startIndex).Take(ItemsPerPage).ToList();
|
||||
var rightItems = TrainInfo.Skip(startIndex+1).Take(ItemsPerPage).ToList();
|
||||
while (leftItems.Count+rightItems.Count < ItemsPerPage*2)
|
||||
var ItemsToShow = TrainInfo.Skip(startIndex).Take(ItemsPerPage * PageCount).ToList();
|
||||
var leftItems = ItemsToShow.Where((item, index) => index % 2 == 0).ToList();
|
||||
var rightItems = ItemsToShow.Where((item, index) => index % 2 == 1).ToList();
|
||||
while (leftItems.Count < ItemsPerPage)
|
||||
{
|
||||
leftItems.Add(new TrainInfo());
|
||||
}
|
||||
while (rightItems.Count < ItemsPerPage)
|
||||
{
|
||||
rightItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in leftItems)
|
||||
{
|
||||
LeftScreen.Add(item);
|
||||
}
|
||||
// while (rightItems.Count < ItemsPerPage)
|
||||
// {
|
||||
// rightItems.Add(new TrainInfo());
|
||||
// }
|
||||
foreach (var item in rightItems)
|
||||
{
|
||||
RightScreen.Add(item);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 28 KiB |
Reference in New Issue
Block a user