mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-11 20:29:45 +08:00
Add files via upload
This commit is contained in:
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