20240301_JSEQ_upperpc/JiangsuEarthquake_test/JiangsuEarthquake/MainWindow.xaml

301 lines
17 KiB
Plaintext
Raw Normal View History

<Window x:Class="JiangsuEarthquake.MainWindow"
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:converters="clr-namespace:JiangsuEarthquake.Common"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:JiangsuEarthquake"
mc:Ignorable="d"
Title="海洋地震综合观测系统" Height="900" Width="1600"
Background="Transparent"
ResizeMode="CanMinimize"
FontFamily="{StaticResource DigitalDisplay}"
FontSize="12"
WindowStartupLocation="CenterScreen">
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="-1" />
</WindowChrome.WindowChrome>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<!--复选框按钮样式-->
<Style x:Key="NavButtonStyle" TargetType="RadioButton">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border Name="back" Background="Transparent" CornerRadius="8">
<ContentControl Margin="20,4" HorizontalAlignment="Center"
VerticalAlignment="Center" Content="{TemplateBinding Content}"
FontSize="18"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="back" Property="Background" Value="#1AFFFFFF"/>
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="back" Property="Background" Value="#44FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="StationChangeStyle" TargetType="RadioButton">
<Setter Property="Width" Value="80"/>
<Setter Property="Height" Value="30"/>
<Setter Property="Foreground" Value="#888"/>
<Setter Property="Background" Value="#DDD"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="Background" Value="Orange"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="DataGridStyle" TargetType="{x:Type DataGrid}">
<Setter Property="AutoGenerateColumns" Value="False"/>
<Setter Property="CanUserAddRows" Value="False"/>
<Setter Property="CanUserDeleteRows" Value="False"/>
<Setter Property="CanUserReorderColumns" Value="False"/>
<Setter Property="CanUserResizeColumns" Value="True"/>
<Setter Property="CanUserResizeRows" Value="False"/>
<Setter Property="CanUserSortColumns" Value="True"/>
<Setter Property="GridLinesVisibility" Value="All"/>
<Setter Property="HeadersVisibility" Value="All"/>
<Setter Property="IsReadOnly" Value="True"/>
<Setter Property="MinRowHeight" Value="40"/>
<Setter Property="Background" Value="#FF285173"/>
<Setter Property="Foreground" Value="White"/>
</Style>
<Style x:Key="ColumnHeaderStyle" TargetType="DataGridColumnHeader">
<Setter Property="Height" Value="30" />
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Background" Value="#FF285173" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
<converters:ConnectConvert x:Key="ConnectConvert" />
<converters:ConnectConvert1 x:Key="ConnectConvert1" />
<converters:ConnectConvert4 x:Key="ConnectConvert4" />
</ResourceDictionary>
</Window.Resources>
<Grid>
<!--背景颜色-->
<Grid.Background>
<RadialGradientBrush>
<!--<GradientStop Offset="0" Color="#FF285173" />
<GradientStop Offset="0.3" Color="#FF244967" />-->
<GradientStop Offset="1" Color="#FF14273A" />
</RadialGradientBrush>
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="45"/>
<RowDefinition Height="38"/>
<RowDefinition Height="45"/>
<RowDefinition/>
<RowDefinition Height="20"/>
</Grid.RowDefinitions>
<!--标题栏部分-->
<Border BorderBrush="#FF285173" BorderThickness="0,0,0,1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="45"/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image Source="Assets/Images/Trademark.png"/>
<TextBlock Grid.Column="1" Text="江苏海洋地震综合观测系统" FontSize="24" HorizontalAlignment="Center"
VerticalAlignment="Center" Foreground="White" Margin="10,0,0,0"/>
<Grid Grid.Column="2">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="13"/>
</Grid.RowDefinitions>
<!--鼠标左键按下拖动事件-->
<Border Height="132" VerticalAlignment="Top" CornerRadius="10,10,0,0"
MouseLeftButtonDown="Border_MouseLeftButtonDown"/>
<!--控制按钮-->
<Border Width="200" HorizontalAlignment="Right" Background="Transparent"
WindowChrome.IsHitTestVisibleInChrome="True">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button Click="MinButton_Click" Background="Transparent" Style="{StaticResource ControlButtonStyle}">
<Button.Content>
<Image Source="Assets/Images/Min.png"/>
</Button.Content>
</Button>
<!--<Button Click="MaxButton_Click" Background="Transparent" Style="{StaticResource ControlButtonStyle}">
<Button.Content>
<Image Source="Assets/Images/Max.png"/>
</Button.Content>
</Button>-->
<Button Click="Button_Click" Background="DarkRed" Style="{StaticResource ControlButtonStyle}">
<Button.Content>
<Image Source="Assets/Images/Close.png"/>
</Button.Content>
</Button>
</StackPanel>
</Border>
<Border Grid.Row="1" BorderBrush="#5518AABD" BorderThickness="0,1,0,0"/>
<Border Grid.Row="1" Margin="0,3,0,2">
<Border.Background>
<VisualBrush TileMode="Tile" Viewport="0,0,7,7" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Width="20" Height="20">
<Line Stroke="Gray" StrokeThickness="1" X1="0" X2="10" Y1="10" Y2="0"/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Border.Background>
</Border>
</Grid>
</Grid>
</Border>
<!--连接状态连接信息-->
<StackPanel Grid.Row="1" Margin="40,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<!--<Button VerticalAlignment="Center" Background="Transparent" BorderThickness="0">
<Button.Content>
<Image Source="Assets/Images/Robot.png"/>
</Button.Content>
</Button>-->
<Image Source="Assets/Images/Robot.png" Height="28"/>
<TextBlock Margin="10,0" VerticalAlignment="Center" FontSize="14" Text="连接状态信息"
Foreground="#99FFFFFF"/>
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="基站通信①:"
FontSize="14"/>
<!--<TextBlock Text="连接状态" Foreground="#99FFFFFF" FontSize="14" VerticalAlignment="Center"/>-->
<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding serverModel1.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding serverModel1.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert1}}"/>
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="基站通信②:"
FontSize="14"/>
<!--<TextBlock Text="连接状态" Foreground="#99FFFFFF" FontSize="14" VerticalAlignment="Center"/>-->
<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding serverModel2.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding serverModel2.IsOpened, Converter={StaticResource ResourceKey=ConnectConvert1}}"/>
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="升压站通信①:"
FontSize="14"/>
<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel1.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel1.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>
<TextBlock Margin="20,0,0,0" VerticalAlignment="Center" Foreground="#99FFFFFF" Text="升压站通信②:"
FontSize="14"/>
<TextBlock VerticalAlignment="Center" FontSize="14"
Foreground="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert}}"
Text="{Binding clientModel2.IsConnected, Converter={StaticResource ResourceKey=ConnectConvert4}}"/>
<Button Width="60" Click="DetailButton_Click" Content="详情" Style="{StaticResource ControlButtonStyle}" Visibility="Hidden">
<!--<Button.ToolTip>
<Border BorderBrush="Black" BorderThickness="1">
<DataGrid ColumnHeaderStyle="{}"
</Border>
</Button.ToolTip>-->
</Button>
</StackPanel>
<!--时间日期状态信息-->
<StackPanel Grid.Row="1" Margin="30,0" HorizontalAlignment="Right" VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock x:Name="DataTime" VerticalAlignment="Center" FontFamily="../Assets/Fonts/#Digital Display"
FontSize="22" Foreground="White"/>
<StackPanel Margin="15,0,0,0" TextBlock.FontSize="12" TextBlock.Foreground="White">
<TextBlock x:Name="Date" HorizontalAlignment="Center" VerticalAlignment="Top"/>
<TextBlock x:Name="Week" HorizontalAlignment="Center" VerticalAlignment="Bottom"/>
</StackPanel>
</StackPanel>
<!--菜单栏部分-->
<Grid Grid.Row="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="1" Content="H8-1"
IsChecked="True" Style="{StaticResource StationChangeStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="2" Content="H9"
Style="{StaticResource StationChangeStyle}"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="RealTimeDataView"
Content="实时数据" IsChecked="True" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="SystemEnvironDataView"
Content="接驳盒环境" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="SystemMonitorDataView"
Content="接驳盒监测" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="SeismometerStateDataView"
Content="地震仪状态" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="SeismometerParameterView"
Content="地震仪参数" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="BoosterStationStateDataView"
Content="升压站状态" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="SystemControlView"
Content="海底基站控制" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="LogRecordView"
Content="日志记录" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="AlarmRecordView"
Content="告警记录" Style="{DynamicResource NavButtonStyle}"/>
</StackPanel>
</Grid>
<!--内容部分-->
<ContentControl Grid.Row="3" Content="{Binding PageContent}"/>
<!--底部装饰-->
<Border Grid.Row="4" BorderBrush="#5518AABD" BorderThickness="0,1,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<Border Margin="0,5">
<Border.Background>
<VisualBrush TileMode="Tile" Viewport="0,0,7,7" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Width="20" Height="20">
<Line Stroke="Gray" StrokeThickness="1" X1="0" X2="10" Y1="10" Y2="0"/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Border.Background>
</Border>
</Grid>
</Border>
</Grid>
</Window>