mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-12 12:45:38 +08:00
@@ -51,6 +51,8 @@
|
||||
services.AddTransient<Views.Shanghai.OutsideScreenView>();
|
||||
services.AddTransient<ViewModels.Hanzhong.PlatformScreenViewModel>();
|
||||
services.AddTransient<Views.Hanzhong.PlatformScreenView>();
|
||||
services.AddTransient<ViewModels.Zibo.PrimaryScreenViewModel>();
|
||||
services.AddTransient<Views.Zibo.PrimaryScreenView>();
|
||||
}).Build();
|
||||
|
||||
[STAThread]
|
||||
|
||||
BIN
CRSim/Assets/StyleImages/ZiBo/PrimaryScreen.png
Normal file
BIN
CRSim/Assets/StyleImages/ZiBo/PrimaryScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
BIN
CRSim/Assets/StyleImages/Zibo/PrimaryScreen.png
Normal file
BIN
CRSim/Assets/StyleImages/Zibo/PrimaryScreen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 92 KiB |
@@ -9,7 +9,7 @@
|
||||
<LangVersion>13.0</LangVersion>
|
||||
<StartupObject>CRSim.App</StartupObject>
|
||||
<ApplicationIcon>Assets\CRSimIcon.ico</ApplicationIcon>
|
||||
<Version>1.2.3.3</Version>
|
||||
<Version>1.2.3.4</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -45,6 +45,7 @@
|
||||
<Resource Include="Assets\StyleImages\Hanzhong\PlatformScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\Harbin\PrimaryScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\Shanghai\OutsideScreen.png" />
|
||||
<Resource Include="Assets\StyleImages\ZiBo\PrimaryScreen.png" />
|
||||
<Resource Include="Assets\win11-dashboard.dark.png" />
|
||||
<Resource Include="Assets\win11-dashboard.light.png" />
|
||||
<EmbeddedResource Include="Models\StylesInfoData.json" />
|
||||
@@ -88,6 +89,13 @@
|
||||
<Compile Update="Views\Windows\Stations\Shanghai\OutsideScreenView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Windows\Stations\Zibo\PrimaryScreenView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</local:HeaderTile>
|
||||
<local:HeaderTile
|
||||
Title="赞助作者"
|
||||
Description="赏作者一口饭吃吧QAQ!传说捐赠者的样式请求会优先满足!"
|
||||
Description="赏作者一口饭吃QAQ"
|
||||
Link="https://afdian.com/a/CRSim"
|
||||
Margin="0 0 6 0">
|
||||
<local:HeaderTile.Source>
|
||||
@@ -65,7 +65,7 @@
|
||||
</local:HeaderTile>
|
||||
<local:HeaderTile
|
||||
Title="开源主页"
|
||||
Description="欢迎贡献代码!当然功能样式请求和Bug反馈也请交到Issue中!"
|
||||
Description="欢迎贡献代码!"
|
||||
Margin="0 0 6 0"
|
||||
Link="https://github.com/denglihong2007/CRSim">
|
||||
<local:HeaderTile.Source>
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
private ITimeService _timeService;
|
||||
private Settings _settings;
|
||||
public SolidColorBrush WaitingColor { get; set; } = new(Colors.White);
|
||||
public SolidColorBrush CheckingTicketsColor { get; set; } = new(Colors.LightGreen);
|
||||
public SolidColorBrush StopCheckingTicketsColor { get; set; } = new(Colors.Red);
|
||||
object IMultiValueConverter.Convert(object[] values, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
var serviceProvider = (IServiceProvider)Application.Current.Resources["ServiceProvider"];
|
||||
@@ -17,7 +19,7 @@
|
||||
//过路站
|
||||
if (_timeService.GetDateTimeNow() > departureTime.Subtract(_settings.PassingCheckInAdvanceDuration) && _timeService.GetDateTimeNow() < departureTime.Subtract(_settings.StopCheckInAdvanceDuration))
|
||||
{
|
||||
return new SolidColorBrush(Colors.LightGreen);
|
||||
return CheckingTicketsColor;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -25,16 +27,16 @@
|
||||
//始发站
|
||||
if (_timeService.GetDateTimeNow() > departureTime.Subtract(_settings.DepartureCheckInAdvanceDuration) && _timeService.GetDateTimeNow() < departureTime.Subtract(_settings.StopCheckInAdvanceDuration))
|
||||
{
|
||||
return new SolidColorBrush(Colors.LightGreen);
|
||||
return CheckingTicketsColor;
|
||||
}
|
||||
}
|
||||
if (_timeService.GetDateTimeNow() > departureTime.Subtract(_settings.StopCheckInAdvanceDuration))
|
||||
{
|
||||
return new SolidColorBrush(Colors.Red);
|
||||
return StopCheckingTicketsColor;
|
||||
}
|
||||
if (values[2] is TimeSpan state && state.TotalMinutes > 0)
|
||||
{
|
||||
return new SolidColorBrush(Colors.Red);
|
||||
return StopCheckingTicketsColor;
|
||||
}
|
||||
return WaitingColor;
|
||||
}
|
||||
|
||||
@@ -85,5 +85,15 @@
|
||||
"Station",
|
||||
"Platform"
|
||||
]
|
||||
},
|
||||
{
|
||||
"UniqueId": "Zibo PrimaryScreen",
|
||||
"Title": "淄博站主要看板",
|
||||
"Station": "Zibo",
|
||||
"StyleName": "PrimaryScreenView",
|
||||
"ImagePath": "Assets/StyleImages/Zibo/PrimaryScreen.png",
|
||||
"Parameters": [
|
||||
"Station"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace CRSim.ViewModels.ZiBo
|
||||
{
|
||||
public class PrimaryScreenViewModel : ScreenViewModel
|
||||
{
|
||||
public ObservableCollection<TrainInfo> LeftScreen { get; private set; } = [];
|
||||
public ObservableCollection<TrainInfo> RightScreen { get; private set; } = [];
|
||||
public PrimaryScreenViewModel(ITimeService timeService, ISettingsService settingsService)
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
ItemsPerPage = 8;
|
||||
PageCount = 2;
|
||||
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)
|
||||
{
|
||||
leftItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in leftItems)
|
||||
{
|
||||
LeftScreen.Add(item);
|
||||
}
|
||||
var rightItems = TrainInfo.Skip(startIndex + ItemsPerPage).Take(ItemsPerPage).ToList();
|
||||
while (rightItems.Count < ItemsPerPage)
|
||||
{
|
||||
rightItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in rightItems)
|
||||
{
|
||||
RightScreen.Add(item);
|
||||
}
|
||||
CurrentPageIndex = CurrentPageIndex + 1 >= Math.Min(_settings.MaxPages, pageCount) ? 0 : CurrentPageIndex + 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
namespace CRSim.ViewModels.Zibo
|
||||
{
|
||||
public class PrimaryScreenViewModel : ScreenViewModel
|
||||
{
|
||||
public ObservableCollection<TrainInfo> LeftScreen { get; private set; } = [];
|
||||
public ObservableCollection<TrainInfo> RightScreen { get; private set; } = [];
|
||||
public PrimaryScreenViewModel(ITimeService timeService, ISettingsService settingsService)
|
||||
: base(timeService, settingsService)
|
||||
{
|
||||
ItemsPerPage = 8;
|
||||
PageCount = 2;
|
||||
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)
|
||||
{
|
||||
leftItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in leftItems)
|
||||
{
|
||||
LeftScreen.Add(item);
|
||||
}
|
||||
var rightItems = TrainInfo.Skip(startIndex + ItemsPerPage).Take(ItemsPerPage).ToList();
|
||||
while (rightItems.Count < ItemsPerPage)
|
||||
{
|
||||
rightItems.Add(new TrainInfo());
|
||||
}
|
||||
foreach (var item in rightItems)
|
||||
{
|
||||
RightScreen.Add(item);
|
||||
}
|
||||
CurrentPageIndex = CurrentPageIndex + 1 >= Math.Min(_settings.MaxPages, pageCount) ? 0 : CurrentPageIndex + 1;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
395
CRSim/Views/Windows/Stations/ZiBo/PrimaryScreenView.xaml
Normal file
395
CRSim/Views/Windows/Stations/ZiBo/PrimaryScreenView.xaml
Normal file
@@ -0,0 +1,395 @@
|
||||
<Window x:Class="CRSim.Views.ZiBo.PrimaryScreenView"
|
||||
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.ZiBo"
|
||||
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">
|
||||
<Window.Resources>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<!-- 去除列头的间距 -->
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
<converters:TicketCheckConverter x:Key="TicketCheckConverter" Separator="" />
|
||||
<converters:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
<converters:TrainStateConverter x:Key="TrainStateConverter" />
|
||||
<converters:TrainStateColorConverter x:Key="TrainStateColorConverter" WaitingColor="white" CheckingTicketsColor="#1ce048" StopCheckingTicketsColor="#df0122"/>
|
||||
</Window.Resources>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<DataGrid ItemsSource="{Binding LeftScreen, Mode=OneWay}" AutoGenerateColumns="False"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False"
|
||||
FontFamily="宋体" FontSize="35" FontWeight="Bold" FontStretch="Condensed"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="55"
|
||||
AlternationCount="2" HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="车次" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Origin}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="始发站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Terminal}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="终到站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding DepartureTime, Converter={StaticResource DateTimeToStringConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="开点" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
|
||||
</DataGridTextColumn>
|
||||
<!-- <DataGridTextColumn Binding="{Binding TicketChecks, Converter={StaticResource TicketCheckConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="150">
|
||||
<TextBlock Text="检票口" HorizontalAlignment="Stretch" Padding="5"
|
||||
Foreground="White" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#0F1633"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn> -->
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Mode="OneWay" Converter="{StaticResource TrainStateConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="状态" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource TrainStateColorConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Style.Triggers>
|
||||
<!-- 偶数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="1">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#000000"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
<!-- 奇数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="0">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#012CF5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</DataGrid>
|
||||
<DataGrid ItemsSource="{Binding RightScreen, Mode=OneWay}" AutoGenerateColumns="False"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False"
|
||||
FontFamily="宋体" FontSize="35" FontWeight="Bold" FontStretch="Condensed"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="55"
|
||||
AlternationCount="2" HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="车次" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Origin}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="始发站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Terminal}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="终到站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding DepartureTime, Converter={StaticResource DateTimeToStringConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="开点" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
|
||||
</DataGridTextColumn>
|
||||
<!-- <DataGridTextColumn Binding="{Binding TicketChecks, Converter={StaticResource TicketCheckConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="150">
|
||||
<TextBlock Text="检票口" HorizontalAlignment="Stretch" Padding="5"
|
||||
Foreground="White" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#0F1633"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn> -->
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Mode="OneWay" Converter="{StaticResource TrainStateConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="状态" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource TrainStateColorConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Style.Triggers>
|
||||
<!-- 偶数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="1">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#000000"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
<!-- 奇数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="0">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#012CF5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</DataGrid>
|
||||
|
||||
</StackPanel>
|
||||
<!-- <StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Background>
|
||||
<SolidColorBrush Color="#012CF5"/>
|
||||
</StackPanel.Background>
|
||||
<TextBlock FontFamily="宋体" Foreground="White" FontSize="18"
|
||||
Text="{Binding Text,Mode=OneWay}">
|
||||
</TextBlock>
|
||||
<Rectangle Width="250" HorizontalAlignment="Stretch"/>
|
||||
<TextBlock FontFamily="宋体" Foreground="White" FontSize="18"
|
||||
Name="labelTime" Text="{Binding CurrentTime}">
|
||||
</TextBlock>
|
||||
</StackPanel> -->
|
||||
</StackPanel>
|
||||
</Window>
|
||||
33
CRSim/Views/Windows/Stations/ZiBo/PrimaryScreenView.xaml.cs
Normal file
33
CRSim/Views/Windows/Stations/ZiBo/PrimaryScreenView.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using CRSim.ViewModels.ZiBo;
|
||||
|
||||
namespace CRSim.Views.ZiBo
|
||||
{
|
||||
/// <summary>
|
||||
/// PrimaryScreen.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PrimaryScreenView : Window
|
||||
{
|
||||
public PrimaryScreenViewModel ViewModel { get; }
|
||||
public PrimaryScreenView(PrimaryScreenViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
395
CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml
Normal file
395
CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml
Normal file
@@ -0,0 +1,395 @@
|
||||
<Window x:Class="CRSim.Views.Zibo.PrimaryScreenView"
|
||||
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.Zibo"
|
||||
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">
|
||||
<Window.Resources>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<!-- 去除列头的间距 -->
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Margin" Value="0"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
</Style>
|
||||
<converters:TicketCheckConverter x:Key="TicketCheckConverter" Separator="" />
|
||||
<converters:DateTimeToStringConverter x:Key="DateTimeToStringConverter" Format="HH:mm" />
|
||||
<converters:TrainStateConverter x:Key="TrainStateConverter" />
|
||||
<converters:TrainStateColorConverter x:Key="TrainStateColorConverter" WaitingColor="white" CheckingTicketsColor="#1ce048" StopCheckingTicketsColor="#df0122"/>
|
||||
</Window.Resources>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<DataGrid ItemsSource="{Binding LeftScreen, Mode=OneWay}" AutoGenerateColumns="False"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False"
|
||||
FontFamily="宋体" FontSize="35" FontWeight="Bold" FontStretch="Condensed"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="55"
|
||||
AlternationCount="2" HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="车次" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Origin}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="始发站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Terminal}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="终到站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding DepartureTime, Converter={StaticResource DateTimeToStringConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="开点" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
|
||||
</DataGridTextColumn>
|
||||
<!-- <DataGridTextColumn Binding="{Binding TicketChecks, Converter={StaticResource TicketCheckConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="150">
|
||||
<TextBlock Text="检票口" HorizontalAlignment="Stretch" Padding="5"
|
||||
Foreground="White" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#0F1633"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn> -->
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Mode="OneWay" Converter="{StaticResource TrainStateConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="状态" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource TrainStateColorConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Style.Triggers>
|
||||
<!-- 偶数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="1">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#000000"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
<!-- 奇数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="0">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#012CF5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</DataGrid>
|
||||
<DataGrid ItemsSource="{Binding RightScreen, Mode=OneWay}" AutoGenerateColumns="False"
|
||||
CanUserResizeColumns="False" CanUserSortColumns="False" CanUserAddRows="False"
|
||||
CanUserResizeRows="False" CanUserReorderColumns="False"
|
||||
FontFamily="宋体" FontSize="35" FontWeight="Bold" FontStretch="Condensed"
|
||||
IsReadOnly="True" GridLinesVisibility="None" RowHeight="55"
|
||||
AlternationCount="2" HeadersVisibility="Column" IsEnabled="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Binding="{Binding TrainNumber}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="车次" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Origin}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="始发站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding Terminal}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="终到站" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn Binding="{Binding DepartureTime, Converter={StaticResource DateTimeToStringConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="开点" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
|
||||
</DataGridTextColumn>
|
||||
<!-- <DataGridTextColumn Binding="{Binding TicketChecks, Converter={StaticResource TicketCheckConverter}}">
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="150">
|
||||
<TextBlock Text="检票口" HorizontalAlignment="Stretch" Padding="5"
|
||||
Foreground="White" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#0F1633"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn> -->
|
||||
<DataGridTextColumn>
|
||||
<DataGridTextColumn.Binding>
|
||||
<MultiBinding Mode="OneWay" Converter="{StaticResource TrainStateConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</DataGridTextColumn.Binding>
|
||||
<DataGridTextColumn.HeaderTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Vertical" Width="200">
|
||||
<TextBlock Text="状态" HorizontalAlignment="Stretch" Padding="10"
|
||||
Foreground="#cfcfcf" TextAlignment="Center">
|
||||
<TextBlock.Background>
|
||||
<SolidColorBrush Color="#132b81"/>
|
||||
</TextBlock.Background>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</DataGridTextColumn.HeaderTemplate>
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="TextAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource TrainStateColorConverter}">
|
||||
<Binding Path="ArrivalTime" />
|
||||
<Binding Path="DepartureTime" />
|
||||
<Binding Path="State" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Style.Triggers>
|
||||
<!-- 偶数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="1">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#000000"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
<!-- 奇数行样式 -->
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=AlternationIndex}" Value="0">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#012CF5"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
</DataGrid>
|
||||
|
||||
</StackPanel>
|
||||
<!-- <StackPanel Orientation="Horizontal">
|
||||
<StackPanel.Background>
|
||||
<SolidColorBrush Color="#012CF5"/>
|
||||
</StackPanel.Background>
|
||||
<TextBlock FontFamily="宋体" Foreground="White" FontSize="18"
|
||||
Text="{Binding Text,Mode=OneWay}">
|
||||
</TextBlock>
|
||||
<Rectangle Width="250" HorizontalAlignment="Stretch"/>
|
||||
<TextBlock FontFamily="宋体" Foreground="White" FontSize="18"
|
||||
Name="labelTime" Text="{Binding CurrentTime}">
|
||||
</TextBlock>
|
||||
</StackPanel> -->
|
||||
</StackPanel>
|
||||
</Window>
|
||||
33
CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml.cs
Normal file
33
CRSim/Views/Windows/Stations/Zibo/PrimaryScreenView.xaml.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using CRSim.ViewModels.Zibo;
|
||||
|
||||
namespace CRSim.Views.Zibo
|
||||
{
|
||||
/// <summary>
|
||||
/// PrimaryScreen.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class PrimaryScreenView : Window
|
||||
{
|
||||
public PrimaryScreenViewModel ViewModel { get; }
|
||||
public PrimaryScreenView(PrimaryScreenViewModel viewModel)
|
||||
{
|
||||
InitializeComponent();
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user