20240801_FJEQ_upperpc/FujianEarthquake_seabed/FujianEarthquake/MainWindow.xaml

306 lines
18 KiB
Plaintext
Raw Normal View History

<Window x:Class="FujianEarthquake.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:FujianEarthquake"
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">
<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 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 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}}"/>-->
<!--<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}}"/>-->
<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}}"/>-->
<!--<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}}"/>-->
</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="400"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel Margin="20,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center"
Orientation="Horizontal">
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="1" Content="海底基站 1#"
IsChecked="True" Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="2" Content="海底基站 2#"
Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="3" Content="海底基站 3#"
Style="{StaticResource StationChangeStyle}" Width="120"/>
<!--<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="4" Content="水池 一体式"
Style="{StaticResource StationChangeStyle}" Width="120"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="5" Content="水池 多接口"
Style="{StaticResource StationChangeStyle}" Width="120"/>-->
</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="JunctionBoxEnvironDataView"
Content="接驳盒环境" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="JunctionBoxStatusDataView"
Content="接驳盒状态" Style="{DynamicResource NavButtonStyle}"/>
<RadioButton Command="{Binding NavChangedCommand}" CommandParameter="ShoreBaseStationStatusDataView"
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>