mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-11 12:15:35 +08:00
feat: 添加安康站出站口看板
This commit is contained in:
@@ -29,5 +29,22 @@ namespace CRSim.Core.Models
|
||||
public string? Landmark { get; set; }
|
||||
|
||||
public int Length { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public StationType StationType
|
||||
{
|
||||
get
|
||||
{
|
||||
if (ArrivalTime == null)
|
||||
{
|
||||
return StationType.Departure;
|
||||
}
|
||||
else if (DepartureTime == null)
|
||||
{
|
||||
return StationType.Arrival;
|
||||
}
|
||||
return StationType.Both;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
15
CRSim.Core/Models/StationType.cs
Normal file
15
CRSim.Core/Models/StationType.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace CRSim.Core.Models
|
||||
{
|
||||
public enum StationType
|
||||
{
|
||||
Arrival,
|
||||
Departure,
|
||||
Both
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,8 @@
|
||||
services.AddTransient<Views.Tianjin.PlatformScreenView>();
|
||||
services.AddTransient<ViewModels.Fuzhou.TicketCheckScreenViewModel>();
|
||||
services.AddTransient<Views.Fuzhou.TicketCheckScreenView>();
|
||||
services.AddTransient<ViewModels.Ankang.ExitScreenViewModel>();
|
||||
services.AddTransient<Views.Ankang.ExitScreenView>();
|
||||
}).Build();
|
||||
|
||||
[STAThread]
|
||||
|
||||
BIN
CRSim/Assets/StyleImages/Ankang/ExitScreen.png
Normal file
BIN
CRSim/Assets/StyleImages/Ankang/ExitScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 47 KiB |
@@ -14,6 +14,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Remove="App.xaml" />
|
||||
<None Remove="Assets\StyleImages\Ankang\ExitScreen.png" />
|
||||
<None Remove="Assets\StyleImages\Fuzhou\TicketCheckScreen.png" />
|
||||
<None Remove="Assets\StyleImages\Tianjin\image.png" />
|
||||
<None Remove="Assets\StyleImages\Tianjin\PlatformScreen.png" />
|
||||
@@ -33,6 +34,7 @@
|
||||
<Resource Include="Assets\HomeHeaderTiles\Header-Afdian.png" />
|
||||
<Resource Include="Assets\HomeHeaderTiles\Header-bilibili.png" />
|
||||
<Resource Include="Assets\HomeHeaderTiles\Header-QQ.png" />
|
||||
<Resource Include="Assets\StyleImages\Ankang\ExitScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\BeijingXi\PrimaryScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\ChengduDong\PrimaryTicketCheckScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\ChengduDong\SecondaryScreen.png" />
|
||||
@@ -84,6 +86,9 @@
|
||||
<Compile Update="Views\Windows\Stations\ChengduDong\PrimaryTicketCheckScreenView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Windows\Stations\Ankang\ExitScreenView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Windows\Stations\Tianjin\PlatformScreenView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -151,5 +151,16 @@
|
||||
"Station",
|
||||
"Text"
|
||||
]
|
||||
},
|
||||
{
|
||||
"UniqueId": "Ankang ExitScreen",
|
||||
"Title": "安康站出站口看板",
|
||||
"Station": "Ankang",
|
||||
"StyleName": "ExitScreenView",
|
||||
"ImagePath": "Assets/StyleImages/Ankang/ExitScreen.png",
|
||||
"Parameters": [
|
||||
"Station",
|
||||
"Text"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -6,7 +6,7 @@
|
||||
public string Origin { get; set; }
|
||||
public string Terminal { get; set; }
|
||||
public DateTime? ArrivalTime { get; set; }
|
||||
public DateTime DepartureTime { get; set; }
|
||||
public DateTime? DepartureTime { get; set; }
|
||||
public List<string> TicketChecks { get; set; }
|
||||
public string WaitingArea { get; set; }
|
||||
public string Platform { get; set; }
|
||||
|
||||
@@ -25,6 +25,8 @@ namespace CRSim.ViewModels
|
||||
|
||||
public List<TrainInfo> TrainInfo { get; set; } = [];
|
||||
|
||||
public StationType StationType = StationType.Both;
|
||||
|
||||
protected ScreenViewModel(ITimeService timeService, ISettingsService settingsService)
|
||||
{
|
||||
|
||||
@@ -42,7 +44,7 @@ namespace CRSim.ViewModels
|
||||
{
|
||||
if (CurrentPageIndex==0)
|
||||
{
|
||||
List<TrainInfo> itemsToRemove = [.. TrainInfo.Where(info => info.DepartureTime.Subtract(_settings.StopDisplayUntilDepartureDuration) < _timeService.GetDateTimeNow())];
|
||||
List<TrainInfo> itemsToRemove = [.. TrainInfo.Where(info => (info.DepartureTime??info.ArrivalTime).Value.Subtract(_settings.StopDisplayUntilDepartureDuration) < _timeService.GetDateTimeNow())];
|
||||
|
||||
foreach (var item in itemsToRemove)
|
||||
{
|
||||
@@ -58,7 +60,7 @@ namespace CRSim.ViewModels
|
||||
|
||||
public Task WaitForDataLoadAsync() => _dataLoaded.Task;
|
||||
|
||||
public void LoadData(Station station,string ticketCheck,string platform)
|
||||
public void LoadData(Station station, string ticketCheck, string platform)
|
||||
{
|
||||
ThisStation = station;
|
||||
ThisPlatform = platform;
|
||||
@@ -67,15 +69,20 @@ namespace CRSim.ViewModels
|
||||
foreach (var trainNumber in trains)
|
||||
{
|
||||
|
||||
if (trainNumber != null && trainNumber.DepartureTime != null && (ticketCheck==string.Empty || trainNumber.TicketChecks.Contains(ticketCheck)) && (platform == string.Empty || trainNumber.Platform==platform))
|
||||
if (trainNumber != null &&
|
||||
(StationType == StationType.Both ||
|
||||
trainNumber.StationType == StationType.Both ||
|
||||
StationType == trainNumber.StationType) &&
|
||||
(ticketCheck == string.Empty || trainNumber.TicketChecks.Contains(ticketCheck)) &&
|
||||
(platform == string.Empty || trainNumber.Platform == platform))
|
||||
{
|
||||
TrainInfo.Add(new TrainInfo
|
||||
{
|
||||
TrainNumber = trainNumber.Number,
|
||||
Terminal = trainNumber.Terminal,
|
||||
Origin = trainNumber.Origin,
|
||||
ArrivalTime = trainNumber.ArrivalTime == null ? null : trainNumber.DepartureTime.Value < _timeService.GetDateTimeNow() ? trainNumber.ArrivalTime.Value.AddDays(1) : trainNumber.ArrivalTime.Value,
|
||||
DepartureTime = trainNumber.DepartureTime.Value < _timeService.GetDateTimeNow() ? trainNumber.DepartureTime.Value.AddDays(1) : trainNumber.DepartureTime.Value,
|
||||
ArrivalTime = trainNumber.ArrivalTime == null ? null : trainNumber.ArrivalTime,
|
||||
DepartureTime = trainNumber.DepartureTime == null ? null : trainNumber.DepartureTime,
|
||||
TicketChecks = trainNumber.TicketChecks,
|
||||
WaitingArea = station.WaitingAreas.Where(x => x.TicketChecks.Intersect(trainNumber.TicketChecks).ToList().Count!=0).FirstOrDefault().Name,
|
||||
Platform = trainNumber.Platform,
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
namespace CRSim.ViewModels.Ankang
|
||||
{
|
||||
public class ExitScreenViewModel : ScreenViewModel
|
||||
{
|
||||
public ObservableCollection<TrainInfo> LeftScreen { get; private set; } = [];
|
||||
public ObservableCollection<TrainInfo> RightScreen { get; private set; } = [];
|
||||
public ExitScreenViewModel(ITimeService timeService, ISettingsService settingsService)
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
Text = $"西安局集团公司推出西铁行APP站车服务产品,欢迎体验使用。";
|
||||
ItemsPerPage = 7;
|
||||
PageCount = 1;
|
||||
StationType = StationType.Arrival;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
private async void Initialize()
|
||||
{
|
||||
await WaitForDataLoadAsync();
|
||||
RefreshDisplay(null,null);
|
||||
}
|
||||
private void RefreshDisplay(object? sender, EventArgs e)
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
{
|
||||
int pageCount = (int)Math.Ceiling((double)TrainInfo.Count / (ItemsPerPage * PageCount));
|
||||
LeftScreen.Clear();
|
||||
RightScreen.Clear();
|
||||
int startIndex = CurrentPageIndex * ItemsPerPage * PageCount;
|
||||
var leftItems = TrainInfo.Skip(startIndex).Take(ItemsPerPage).ToList();
|
||||
while (leftItems.Count < ItemsPerPage) // Fill up with new object() if not enough items
|
||||
{
|
||||
leftItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in leftItems)
|
||||
{
|
||||
LeftScreen.Add(item);
|
||||
}
|
||||
|
||||
// Get the slice for the right screen (next 12)
|
||||
var rightItems = TrainInfo.Skip(startIndex + ItemsPerPage).Take(ItemsPerPage).ToList();
|
||||
while (rightItems.Count < ItemsPerPage) // Fill up with new object() if not enough items
|
||||
{
|
||||
rightItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in rightItems)
|
||||
{
|
||||
RightScreen.Add(item);
|
||||
}
|
||||
|
||||
CurrentPageIndex = CurrentPageIndex + 1 >= Math.Min(_settings.MaxPages, pageCount) ? 0 : CurrentPageIndex + 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@
|
||||
{
|
||||
ItemsPerPage = 13;
|
||||
PageCount = 2;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
Text = "持户口簿、护照、临时身份证的旅客,请在非居民身份证通道排队。请主动礼让老、弱、病、残、孕的旅客。";
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
Text = " 检票口信息请以车站显示屏信息为准。公共场所请妥善保管个人贵重物品。";
|
||||
ItemsPerPage = 12;
|
||||
PageCount = 2;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
Text = $"开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票";
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
Text = "成都铁路客服电话:028-12306";
|
||||
ItemsPerPage = 12;
|
||||
PageCount = 1;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
Text = $"开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票";
|
||||
ItemsPerPage = 6;
|
||||
PageCount = 2;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
{
|
||||
ItemsPerPage = 9;
|
||||
PageCount = 1;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
{
|
||||
ItemsPerPage = 9;
|
||||
PageCount = 1;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
{
|
||||
ItemsPerPage = 8;
|
||||
PageCount = 2;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
Text = $"开车前{settingsService.GetSettings().StopCheckInAdvanceDuration.TotalMinutes}分钟停止检票";
|
||||
ItemsPerPage = 18;
|
||||
PageCount = 1;
|
||||
StationType = StationType.Departure;
|
||||
timeService.RefreshSecondsElapsed += RefreshDisplay;
|
||||
Initialize();
|
||||
}
|
||||
|
||||
172
CRSim/Views/Windows/Stations/Ankang/ExitScreenView.xaml
Normal file
172
CRSim/Views/Windows/Stations/Ankang/ExitScreenView.xaml
Normal file
@@ -0,0 +1,172 @@
|
||||
<Window x:Class="CRSim.Views.Ankang.ExitScreenView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:CRSim.Views.Ankang"
|
||||
mc:Ignorable="d"
|
||||
xmlns:converters="clr-namespace:CRSim.Converters"
|
||||
Title="引导屏" SizeToContent="WidthAndHeight"
|
||||
WindowStyle="None" AllowsTransparency="True" Background="Transparent"
|
||||
KeyDown="Window_KeyDown" ResizeMode="NoResize" MouseDown="Window_MouseDown"
|
||||
FontFamily="微软雅黑" FontSize="20">
|
||||
<Window.Resources>
|
||||
<converters:TicketCheckConverter x:Key="TicketCheckConverter" Separator=" - " />
|
||||
<converters:EmptyToVisibilityConverter x:Key="EmptyToVisibilityConverter" />
|
||||
<converters:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
<converters:DateTimeToStringConverter x:Key="DateTimeToStringTimeConverter" Format="yyyy-MM-dd HH:mm:ss" />
|
||||
<converters:TrainStateConverter x:Key="TrainStateConverter" WaitingText="正点"/>
|
||||
<converters:TrainStateColorConverter x:Key="TrainStateColorConverter" WaitingColor="#76C1FF"/>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
<Style x:Key="CommonTextBlockStyle" TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style x:Key="CommonRowStyle" TargetType="DataGridRow">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="1">
|
||||
<Setter Property="Background" Value="#0252AB"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="0">
|
||||
<Setter Property="Background" Value="#028AF6"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style x:Key="CommonHeaderStyle" TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#185C9D"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#F2D673"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Window.Resources>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<DataGrid ItemsSource="{Binding LeftScreen, Mode=OneWay}" AutoGenerateColumns="False"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="30"
|
||||
RowStyle="{StaticResource CommonRowStyle}"
|
||||
AlternationCount="2" HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}" MinWidth="145">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}}" Margin="0,0,0,1">
|
||||
<TextBlock Text="车 次" Style="{StaticResource CommonHeaderStyle}" FontSize="22" Padding="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource CommonTextBlockStyle}"/>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Binding="{Binding Origin}" MinWidth="145">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}}" Margin="0,0,0,1">
|
||||
<TextBlock Text="始发站" Style="{StaticResource CommonHeaderStyle}" FontSize="22" Padding="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource CommonTextBlockStyle}"/>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Binding="{Binding Terminal}" MinWidth="145">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}}" Margin="0,0,0,1">
|
||||
<TextBlock Text="终到站" Style="{StaticResource CommonHeaderStyle}" FontSize="22" Padding="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource CommonTextBlockStyle}"/>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn Binding="{Binding ArrivalTime, Converter={StaticResource DateTimeToStringConverter}}" MinWidth="145">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}}" Margin="0,0,0,1">
|
||||
<TextBlock Text="到 点" Style="{StaticResource CommonHeaderStyle}" FontSize="22" Padding="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource CommonTextBlockStyle}"/>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Platform}" MinWidth="145">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}}" Margin="0,0,0,1">
|
||||
<TextBlock Text="站 台" Style="{StaticResource CommonHeaderStyle}" FontSize="22" Padding="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource CommonTextBlockStyle}"/>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<DataGridTextColumn MinWidth="180">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridColumnHeader}}" Margin="0,0,0,1">
|
||||
<TextBlock Text="状 态" Style="{StaticResource CommonHeaderStyle}" FontSize="22" Padding="0,2,0,0"/>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock" BasedOn="{StaticResource CommonTextBlockStyle}">
|
||||
<Setter Property="Text" Value="正点"/>
|
||||
<Setter Property="Visibility" Value="{Binding TrainNumber,Converter={StaticResource EmptyToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<Grid Background="#012B67" HorizontalAlignment="Stretch">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal" Background="#0484DB" Margin="6,6,0,4">
|
||||
<TextBlock FontFamily="{StaticResource SymbolThemeFontFamily}" Text=""
|
||||
VerticalAlignment="Center" Margin="4,2" Foreground="#9AFFFF"
|
||||
FontWeight="Bold" FontSize="15"/>
|
||||
<TextBlock Text="温馨提示" VerticalAlignment="Center" Margin="0,2,2,2"
|
||||
Foreground="#9AFFFF" FontWeight="Bold" FontSize="15"/>
|
||||
</StackPanel>
|
||||
<Polygon Grid.Column="1" Points="0,0 0,23.8 12,11.9" Margin="0,6,0,4" Fill="#0484DB"/>
|
||||
<TextBlock Grid.Column="2" Text="{Binding Text}" Margin="12,6,0,4" Foreground="White"
|
||||
FontWeight="Bold" FontSize="17" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Column="6" Text="{Binding CurrentTime,Converter={StaticResource DateTimeToStringTimeConverter}}"
|
||||
Foreground="#F2D673" Margin="0,0,40,0" FontWeight="Bold" FontSize="19" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
<Rectangle Height="3" Fill="#028AF6"/>
|
||||
</StackPanel>
|
||||
</Window>
|
||||
34
CRSim/Views/Windows/Stations/Ankang/ExitScreenView.xaml.cs
Normal file
34
CRSim/Views/Windows/Stations/Ankang/ExitScreenView.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using CRSim.ViewModels.Ankang;
|
||||
|
||||
namespace CRSim.Views.Ankang
|
||||
{
|
||||
/// <summary>
|
||||
/// SecondaryScreen.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ExitScreenView : Window
|
||||
{
|
||||
public ExitScreenViewModel ViewModel { get; }
|
||||
public ExitScreenView(ExitScreenViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
RenderOptions.SetEdgeMode(this, EdgeMode.Aliased);
|
||||
ViewModel = viewModel;
|
||||
DataContext = viewModel;
|
||||
}
|
||||
private void Window_MouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
DragMove();
|
||||
}
|
||||
}
|
||||
|
||||
private void Window_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.Key == Key.Escape)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@
|
||||
<converters:TrainStateConverter x:Key="TrainStateConverter" WaitingText="正在候车"/>
|
||||
<converters:TrainStateColorConverter x:Key="TrainStateColorConverter"/>
|
||||
<converters:LandmarkToStringConverter x:Key="LandmarkToStringConverter"/>
|
||||
<converters:EmptyToVisibilityConverter x:Key="EmptyToVisibilityConverter" />
|
||||
<converters:NumberToStringConverter x:Key="NumberToStringConverter"/>
|
||||
<converters:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
</Window.Resources>
|
||||
@@ -96,6 +97,7 @@
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="#EF66F4"/>
|
||||
<Setter Property="Visibility" Value="{Binding TrainNumber,Converter={StaticResource EmptyToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
@@ -138,6 +140,7 @@
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="TextAlignment" Value="Center"/>
|
||||
<Setter Property="Visibility" Value="{Binding TrainNumber,Converter={StaticResource EmptyToVisibilityConverter}}"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
Reference in New Issue
Block a user