添加淄博站廊桥看板

This commit is contained in:
wxl0430
2025-04-19 12:02:06 +08:00
committed by GitHub
parent 1cfc64694c
commit 71c5850b37
8 changed files with 301 additions and 1 deletions

View File

@@ -0,0 +1,36 @@
using CRSim.Core.Models;
using CRSim.Core.Services;
using CRSim.ScreenSimulator.Models;
using System.Collections.ObjectModel;
using System.Windows;
namespace CRSim.ScreenSimulator.ViewModels.Zibo
{
public class ConcourseBridgeScreenViewModel : ScreenViewModel
{
public ObservableCollection<TrainInfo> Screen { get; set; } = [];
public ConcourseBridgeScreenViewModel(ITimeService timeService, ISettingsService settingsService)
: base(timeService, settingsService)
{
StationType = StationType.Departure;
timeService.RefreshSecondsElapsed += RefreshDisplay;
Initialize();
}
private async void Initialize()
{
ItemsPerPage = 2;
await WaitForDataLoadAsync();
RefreshDisplay(null,null);
}
private void RefreshDisplay(object? sender, EventArgs e)
{
Application.Current.Dispatcher.Invoke(() =>
{
Screen.Clear();
for (int i = 0; i < ItemsPerPage; i++)
{
Screen.Add(TrainInfo.Count > i ? TrainInfo[i] : new());
}
});
}
}
}