20230724_MBJC_upperpc/Views/FirstPageView.xaml
2024-03-06 17:46:55 +08:00

503 lines
24 KiB
XML

<UserControl
x:Class="_20230724_MBJC_upperpc.Views.FirstPageView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:_20230724_MBJC_upperpc.Common"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:_20230724_MBJC_upperpc.Views"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tool="clr-namespace:_3DTools;assembly=3DTools"
Name="Window"
d:DesignHeight="900"
d:DesignWidth="1600"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<converters:AspectRatioConverter x:Key="AspectRatioConverter" />
<converters:BottomCenterYConverter x:Key="BottomCenterYConverter" />
<converters:CenterConverterX x:Key="CenterConverterX" />
<converters:CenterConverterX_Half x:Key="CenterConverterX_Half" />
<Style x:Key="StationChangeStyle" TargetType="RadioButton">
<Setter Property="Width" Value="50" />
<Setter Property="Height" Value="22" />
<Setter Property="Foreground" Value="#888" />
<Setter Property="Background" Value="#DDD" />
<Setter Property="FontSize" Value="11" />
<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>
</ResourceDictionary>
</UserControl.Resources>
<Canvas>
<!-- 浮标本体 -->
<local:FirstPageBuoyControl
x:Name="Buoy"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=3}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=2}"
Panel.ZIndex="1"
Beacon="{Binding Beacon1.Beacon}"
ButtonClick="Buoy_ButtonClick"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX_Half}">
<Binding ElementName="Window" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX_Half}">
<Binding ElementName="Window" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
</local:FirstPageBuoyControl>
<!-- 锚1 -->
<local:FirstPageAnchorControl
x:Name="Anchor1"
Canvas.Top="0"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon1.Beacon}"
ButtonClick="Anchor1_ButtonClick"
Model_Visibility="{Binding Beacon1.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualWidth" />
<Binding ElementName="Anchor1" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
</local:FirstPageAnchorControl>
<!-- 锚2 -->
<local:FirstPageAnchorControl
x:Name="Anchor2"
Canvas.Top="0"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon2.Beacon}"
ButtonClick="Anchor2_ButtonClick"
Model_Visibility="{Binding Beacon2.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
</local:FirstPageAnchorControl>
<!-- 锚3 -->
<local:FirstPageAnchorControl
x:Name="Anchor3"
Canvas.Left="0"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Margin="20,0,0,0"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon3.Beacon}"
ButtonClick="Anchor3_ButtonClick"
Model_Visibility="{Binding Beacon3.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualHeight" />
<Binding ElementName="Anchor3" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
</local:FirstPageAnchorControl>
<!-- 锚4 -->
<local:FirstPageAnchorControl
x:Name="Anchor4"
Canvas.Left="0"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Margin="20,0,0,0"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon4.Beacon}"
ButtonClick="Anchor4_ButtonClick"
Model_Visibility="{Binding Beacon4.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
</local:FirstPageAnchorControl>
<!-- 锚5 -->
<local:FirstPageAnchorControl
x:Name="Anchor5"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon5.Beacon}"
ButtonClick="Anchor5_ButtonClick"
Model_Visibility="{Binding Beacon5.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualHeight" />
<Binding ElementName="Anchor5" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX}" ConverterParameter="RightBottom">
<Binding ElementName="Window" Path="ActualWidth" />
<Binding ElementName="Anchor5" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
</local:FirstPageAnchorControl>
<!-- 锚6 -->
<local:FirstPageAnchorControl
x:Name="Anchor6"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon6.Beacon}"
ButtonClick="Anchor6_ButtonClick"
Model_Visibility="{Binding Beacon6.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX}" ConverterParameter="RightBottom">
<Binding ElementName="Window" Path="ActualWidth" />
<Binding ElementName="Anchor6" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
</local:FirstPageAnchorControl>
<!-- 信标1 -->
<local:FirstPageAnchorControl
x:Name="Support1"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon7.Beacon}"
ButtonClick="Support1_ButtonClick"
Model_Visibility="{Binding Beacon7.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX}" ConverterParameter="RightBottom">
<Binding ElementName="Window" Path="ActualHeight" />
<Binding ElementName="Support1" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualWidth" />
<Binding ElementName="Support1" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
</local:FirstPageAnchorControl>
<!-- 信标2 -->
<local:FirstPageAnchorControl
x:Name="Support2"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=8}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4.5}"
Panel.ZIndex="1"
AlarmInfo="告警:文件传输失败"
Beacon="{Binding Beacon8.Beacon}"
ButtonClick="Support2_ButtonClick"
Model_Visibility="{Binding Beacon8.Model_Visibility}"
TBDEnable="False"
Text_Color="#99FFFFFF">
<Canvas.Top>
<MultiBinding Converter="{StaticResource CenterConverterX}" ConverterParameter="RightBottom">
<Binding ElementName="Window" Path="ActualHeight" />
<Binding ElementName="Support1" Path="ActualHeight" />
</MultiBinding>
</Canvas.Top>
<Canvas.Left>
<MultiBinding Converter="{StaticResource CenterConverterX}">
<Binding ElementName="Window" Path="ActualWidth" />
</MultiBinding>
</Canvas.Left>
</local:FirstPageAnchorControl>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="1">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Anchor1" Path="(Canvas.Left)" />
<Binding ElementName="Anchor1" Path="ActualWidth" />
<Binding ElementName="Anchor1" Path="ActualHeight" />
<Binding ElementName="Anchor1" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="2">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Anchor2" Path="(Canvas.Left)" />
<Binding ElementName="Anchor2" Path="ActualWidth" />
<Binding ElementName="Anchor2" Path="ActualHeight" />
<Binding ElementName="Anchor2" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="3">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Anchor3" Path="(Canvas.Left)" />
<Binding ElementName="Anchor3" Path="ActualWidth" />
<Binding ElementName="Anchor3" Path="ActualHeight" />
<Binding ElementName="Anchor3" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="4">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Anchor4" Path="(Canvas.Left)" />
<Binding ElementName="Anchor4" Path="ActualWidth" />
<Binding ElementName="Anchor4" Path="ActualHeight" />
<Binding ElementName="Anchor4" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="5">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Anchor5" Path="(Canvas.Left)" />
<Binding ElementName="Anchor5" Path="ActualWidth" />
<Binding ElementName="Anchor5" Path="ActualHeight" />
<Binding ElementName="Anchor5" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="6">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Anchor6" Path="(Canvas.Left)" />
<Binding ElementName="Anchor6" Path="ActualWidth" />
<Binding ElementName="Anchor6" Path="ActualHeight" />
<Binding ElementName="Anchor6" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeDashArray="1,2"
StrokeDashCap="Round"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="7">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Support1" Path="(Canvas.Left)" />
<Binding ElementName="Support1" Path="ActualWidth" />
<Binding ElementName="Support1" Path="ActualHeight" />
<Binding ElementName="Support1" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Polyline
Panel.ZIndex="0"
Opacity="0.3"
Stroke="SkyBlue"
StrokeDashArray="1,2"
StrokeDashCap="Round"
StrokeThickness="10">
<Polyline.Points>
<MultiBinding Converter="{StaticResource BottomCenterYConverter}" ConverterParameter="8">
<Binding ElementName="Buoy" Path="(Canvas.Left)" />
<Binding ElementName="Buoy" Path="ActualWidth" />
<Binding ElementName="Buoy" Path="ActualHeight" />
<Binding ElementName="Buoy" Path="(Canvas.Top)" />
<Binding ElementName="Support2" Path="(Canvas.Left)" />
<Binding ElementName="Support2" Path="ActualWidth" />
<Binding ElementName="Support2" Path="ActualHeight" />
<Binding ElementName="Support2" Path="(Canvas.Top)" />
</MultiBinding>
</Polyline.Points>
</Polyline>
<Grid
Canvas.Top="0"
Canvas.Right="0"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4}">
<Grid.RowDefinitions>
<RowDefinition Height="23" />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel
HorizontalAlignment="Right"
VerticalAlignment="Top"
Orientation="Horizontal">
<RadioButton
Command="{Binding NavChangedCommand}"
CommandParameter="1"
Content="近一天"
IsChecked="True"
Style="{DynamicResource StationChangeStyle}" />
<RadioButton
Command="{Binding NavChangedCommand}"
CommandParameter="2"
Content="近一周"
Style="{DynamicResource StationChangeStyle}" />
<RadioButton
Command="{Binding NavChangedCommand}"
CommandParameter="3"
Content="近一月"
Style="{DynamicResource StationChangeStyle}" />
</StackPanel>
<ItemsControl
Name="AlarmInfo"
Canvas.Top="0"
Canvas.Right="0"
Width="{Binding ElementName=Window, Path=ActualWidth, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4}"
Height="{Binding ElementName=Window, Path=ActualHeight, Converter={StaticResource AspectRatioConverter}, ConverterParameter=4}"
ItemsSource="{Binding AlarmList}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Height="23">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="20" />
<ColumnDefinition Width="30" />
<ColumnDefinition Width="1.3*" />
<ColumnDefinition />
<ColumnDefinition Width="1.5*" />
</Grid.ColumnDefinitions>
<Border
Width="6"
Height="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Background="IndianRed"
CornerRadius="3" />
<TextBlock
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="Normal"
Foreground="#992BEDF1"
Text="{Binding StationID}" />
<TextBlock
Grid.Column="2"
VerticalAlignment="Center"
FontWeight="Normal"
Foreground="#992BEDF1"
Text="{Binding RecordTime, StringFormat=yyyy/MM/dd HH:mm:ss}" />
<TextBlock
Grid.Column="3"
VerticalAlignment="Center"
FontWeight="Normal"
Foreground="#992BEDF1"
Text="{Binding ParaName}" />
<TextBlock
Grid.Column="4"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="Normal"
Foreground="#992BEDF1"
Text="{Binding ParaState}" />
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</Grid>
</Canvas>
</UserControl>