20211010_CZPM_upperpc/垂直剖面动态观测系统/View/MainView.xaml

121 lines
7.6 KiB
Plaintext
Raw Normal View History

2023-07-27 03:01:29 +00:00
<Window x:Class="垂直剖面动态观测系统.View.MainView"
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:垂直剖面动态观测系统"
xmlns:converter="clr-namespace:垂直剖面动态观测系统.Converter"
mc:Ignorable="d"
Title="浮标海床基监测系统显示控制平台" Height="800" Width="1250"
FontFamily="Microsoft YaHei" FontWeight="ExtraLight" FontSize="12"
ResizeMode="NoResize" WindowStartupLocation="CenterScreen"
WindowStyle="None" AllowsTransparency="True" Background="{x:Null}" Icon="../Assets/Images/Logo.png">
<!--ResizeMode="NoResize" 禁用用户调整大小 去除最大最小按钮
WindowStartupLocation="CenterScreen" 设置程序开启时在屏幕中心
WindowStyle="None" 清空窗体自带样式
AllowsTransparency="True" 允许窗体透明
Background="{x:Null}" 设置窗体背景色为透明
Icon="../Assets/Images/Logo.png" 设置图标为 Logo.png
-->
<!--资源-->
<Window.Resources>
<!--资源字典-->
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--统一的按钮样式-->
<ResourceDictionary Source="../Assets/Styles/DefaultStyle.xaml"/>
<ResourceDictionary>
<!--在资源里定义一下converter 用的时候直接调用genderConverter就行了-->
<converter:GenderConverter x:Key="genderConverter"/>
<!--复选框按钮样式-->
<Style TargetType="RadioButton" x:Key="NavButtonStyle">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Border Background="Transparent" CornerRadius="8" Name="back">
<ContentControl Content="{TemplateBinding Content}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20,4" FontSize="13"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="back" Property="Background" Value="#44FFFFFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<!--主界面 向内边框 背景色 圆角-->
<Border Margin="5" CornerRadius="10">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
<GradientStop Color="#004EA1" Offset="0.0" />
<GradientStop Color="#004EA1" Offset="0.3" />
<GradientStop Color="White" Offset="1.5" />
</LinearGradientBrush>
</Border.Background>
<!--设置阴影-->
<Border.Effect>
<!-- 阴影效果 阴影颜色 阴影深度 模糊半径 透明度 方向 0 向下 -->
<DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0" />
</Border.Effect>
<Grid>
<!--顶栏 设置鼠标左键按下事件(可以拖动窗口)-->
<Border Background="#004EA1" Height="132" VerticalAlignment="Top" CornerRadius="10,10,0,0" MouseLeftButtonDown="Border_MouseLeftButtonDown"/>
<!--窗口控制按钮 最小化 最大化 关闭按钮-->
<!-- 设置水平排列 顶部 右侧-->
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right">
<Button Style="{StaticResource WindowControlButtonStyle}" Content="&#xe65a;" Click="btnMin_Click"/>
<Button Style="{StaticResource WindowControlButtonStyle}" Content="&#xe692;" Click="btnMax_Click"/>
<Button Style="{StaticResource WindowControlButtonStyle}" Content="&#xeb6a;" Click="btnClose_Click"/>
</StackPanel>
<Grid Margin="50,20">
<!--将Grid分为三行-->
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition Height="35"/>
<RowDefinition/>
</Grid.RowDefinitions>
<!--第一行-->
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">
<Border Background="White" CornerRadius="30">
<Image Source="../Assets/Images/Logo.png" Width="60" Height="60"/>
</Border>
<StackPanel Margin="15,0,0,0">
<TextBlock Text="浮标海床基监测系统显示控制平台" Foreground="White" FontSize="25"/>
<TextBlock Text="中国地质调查局 China Geological Survey " Foreground="#88DDDDDD" FontSize="15"/>
</StackPanel>
</StackPanel>
<!--第二行-->
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center">
<!--系统电能环境参数-->
<RadioButton Content="首页" Style="{DynamicResource NavButtonStyle}" IsChecked="True" Command="{Binding NavChangedCommand}" CommandParameter="FirstPageView"/>
<!--浮标传感器数据-->
<RadioButton Content="浮标" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="BuoyPageView"/>
<!--潜标传感器数据-->
<RadioButton Content="潜标" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="LattargetPageView"/>
<!--接驳盒传感器数据-->
<RadioButton Content="接驳盒" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="ConboxPageView"/>
<!--系统控制-->
<RadioButton Content="系统控制" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="ControlPageView"/>
<!--日志记录-->
<RadioButton Content="日志记录" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="LogView"/>
<RadioButton Content="历史记录" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="test"/>
<RadioButton Content="视频监控" Style="{DynamicResource NavButtonStyle}" Command="{Binding NavChangedCommand}" CommandParameter="VideoRecord"/>
</StackPanel>
<ContentControl Grid.Row="2" Content="{Binding MainContent}"/>
</Grid>
</Grid>
</Border>
</Window>