<UserControl x:Class="Txgy.EWS.Client.PageModule.Views.EarlyWarningViewBak"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:Txgy.EWS.Client.PageModule.Views"
             xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             xmlns:lcusb="http://schemas.arction.com/ChartingMVVM/ultimate/"
             xmlns:prism="http://prismlibrary.com/"
             xmlns:myuc="clr-namespace:Txgy.Controls;assembly=Txgy.Controls"
             prism:ViewModelLocator.AutoWireViewModel="True"
             d:DesignHeight="800"
             d:DesignWidth="1600"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Txgy.EWS.Client.Assets;component/Styles/BaseResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="120" />
            <RowDefinition Height="1.5*" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <UniformGrid Columns="4">
            <md:Card Height="100"
                     MinWidth="170"
                     MaxWidth="240"
                     Margin="15,5,5,10"
                     HorizontalAlignment="Stretch"
                     UniformCornerRadius="5"
                     Background="White">
                <Grid>
                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                        <TextBlock Margin="5,0,0,5"
                                   Text="事件频度"
                                   FontSize="16" />
                        <TextBlock Margin="5,0,0,0"
                                   d:Text="5个/小时"
                                   Text="{Binding EventFrequencyCount, StringFormat={}{0}个/小时}"
                                   FontSize="24" />
                    </StackPanel>
                    <TextBlock Margin="0,0,5,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe608;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </Grid>
            </md:Card>
            <md:Card Height="100"
                     MinWidth="170"
                     MaxWidth="240"
                     Margin="5,5,5,10"
                     HorizontalAlignment="Stretch"
                     UniformCornerRadius="5"
                     Background="White">
                <Grid>
                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                        <TextBlock Margin="5,0,0,5"
                                   Text="事件震级"
                                   FontSize="16" />
                        <TextBlock Margin="5,0,0,0"
                                   d:Text="-1.0"
                                   Text="{Binding LastAlarmEventML, StringFormat={}{0:F2}}"
                                   FontSize="28" />
                    </StackPanel>
                    <TextBlock Margin="0,0,10,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe602;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </Grid>
            </md:Card>
            <md:Card Height="100"
                     MinWidth="170"
                     MaxWidth="240"
                     Margin="5,5,5,10"
                     HorizontalAlignment="Stretch"
                     UniformCornerRadius="5"
                     Background="White">
                <Grid>
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock Margin="5,0,0,5"
                                   Text="事件能量"
                                   FontSize="16" />
                        <TextBlock Margin="5,0,0,0"
                                   d:Text="1500J"
                                   Text="{Binding LastAlarmEventEnergy, StringFormat={}{0:F2}J}"
                                   FontSize="24" />
                    </StackPanel>
                    <TextBlock Margin="0,0,10,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe63e;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </Grid>
            </md:Card>
            <md:Card Height="100"
                     MinWidth="170"
                     MaxWidth="240"
                     Margin="5,5,10,10"
                     HorizontalAlignment="Stretch"
                     UniformCornerRadius="5"
                     Background="White">
                <Grid>
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock Margin="10,0,0,5"
                                   Text="事件主频"
                                   FontSize="16" />
                        <TextBlock Margin="10,0,0,0"
                                   d:Text="15"
                                   Text="{Binding LastAlarmEventDominFreq}"
                                   FontSize="24" />
                    </StackPanel>
                    <TextBlock Margin="0,0,10,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe6f8;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </Grid>
            </md:Card>
            <!--<Button Width="100"
                    Height="50"
                    Content="Test"
                    Click="Button_Click"
                    FontSize="24" />-->
        </UniformGrid>
        <!--<UniformGrid Columns="4">
            <md:Card Height="100"
                     Width="auto"
                     Margin="0,5,0,10"
                     HorizontalAlignment="Center"
                     UniformCornerRadius="5"
                     Background="Blue">
                <Grid>
                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                        <TextBlock Margin="5,0,0,5"
                                   Text="事件频度"
                                   FontSize="16" />
                        <TextBlock Margin="5,0,0,0"
                                   d:Text="5个/小时"
                                   Text="{Binding EventFrequencyCount, StringFormat={}{0}个/小时}"
                                   FontSize="24" />
                    </StackPanel>
                    <TextBlock Margin="0,0,5,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe608;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </Grid>
            </md:Card>
            <md:Card Width="240"
                     Height="100"
                     MinWidth="240"
                     Margin="10,5,5,10"
                     HorizontalAlignment="Center"
                     UniformCornerRadius="5"
                     Background="White">
                <StackPanel Orientation="Horizontal">
                    <StackPanel HorizontalAlignment="Left" VerticalAlignment="Center">
                        <TextBlock Margin="10,0,10,5"
                                   Text="事件震级"
                                   FontSize="16" />
                        <TextBlock Margin="10,0,0,0"
                                   d:Text="-1.0"
                                   Text="{Binding LastAlarmEventML, StringFormat={}{0:F2}}"
                                   FontSize="28" />
                    </StackPanel>
                    <TextBlock Margin="60,0,0,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe602;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </StackPanel>
            </md:Card>
            <md:Card Width="240"
                     Height="100"
                     MinWidth="240"
                     Margin="10,5,5,10"
                     HorizontalAlignment="Center"
                     UniformCornerRadius="5"
                     Background="White">
                <StackPanel Orientation="Horizontal">
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock Margin="10,0,10,5"
                                   Text="事件能量"
                                   FontSize="16" />
                        <TextBlock Margin="10,0,0,0"
                                   d:Text="1500J"
                                   Text="{Binding LastAlarmEventEnergy, StringFormat={}{0:F2}J}"
                                   FontSize="24" />
                    </StackPanel>
                    <TextBlock Margin="60,0,0,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe63e;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </StackPanel>
            </md:Card>
            <md:Card Width="240"
                     Height="100"
                     MinWidth="240"
                     Margin="10,5,5,10"
                     HorizontalAlignment="Center"
                     UniformCornerRadius="5"
                     Background="White">
                <StackPanel Orientation="Horizontal">
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock Margin="10,0,10,5"
                                   Text="事件主频"
                                   FontSize="16" />
                        <TextBlock Margin="10,0,0,0"
                                   d:Text="15"
                                   Text="{Binding LastAlarmEventDominFreq}"
                                   FontSize="24" />
                    </StackPanel>
                    <TextBlock Margin="40,0,0,0"
                               HorizontalAlignment="Right"
                               VerticalAlignment="Center"
                               Text="&#xe6f8;"
                               FontSize="64"
                               Foreground="#7a40f2"
                               FontFamily="{StaticResource Iconfont}" />
                </StackPanel>
            </md:Card>
        -->
        <!--<Button Width="100"
                    Height="50"
                    Content="Test"
                    Click="Button_Click"
                    FontSize="24" />-->
        <!--
        </UniformGrid>-->
        <!--#region 中间视图-->
        <UniformGrid Grid.Row="1" Columns="2">
            <!--#region 事件频度图-->
            <md:Card Margin="15,10,5,10"
                     md:ThemeAssist.Theme="Light"
                     UniformCornerRadius="5">
                <Grid>
                    <TextBlock Margin="5"
                               Text="近一小时事件频度"
                               FontFamily="微软雅黑"
                               FontSize="16" />
                    <lvc:CartesianChart Margin="5,25,5,5">
                        <lvc:CartesianChart.Series>
                            <lvc:LineSeries Stroke="#2980b9"
                                            Fill="Transparent"
                                            PointGeometrySize="0"
                                            Values="{Binding ListEventFre}" />

                        </lvc:CartesianChart.Series>
                        <lvc:CartesianChart.AxisX>
                            <lvc:Axis MinValue="0"
                                      ShowLabels="True"
                                      MaxValue="20"
                                      Labels="{Binding EventFreLabels, UpdateSourceTrigger=PropertyChanged}">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Step="5" Stroke="Transparent">
                                    </lvc:Separator>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisX>
                        <lvc:CartesianChart.AxisY>
                            <lvc:Axis MinValue="0"
                                      MaxValue="{Binding EventFreMaxY}"
                                      ShowLabels="True">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="Transparent" />
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisY>
                    </lvc:CartesianChart>
                </Grid>
            </md:Card>
            <!--#endregion-->

            <!--#region 平面图-->
            <md:Card x:Name="planCard"
                     Margin="10"
                     md:ThemeAssist.Theme="Light"
                     UniformCornerRadius="5">
                <Grid>
                    <Canvas Background="White"
                            MouseWheel="Canvas_MouseWheel"
                            MouseLeftButtonDown="Canvas_MouseLeftButtonDown"
                            MouseLeftButtonUp="Canvas_MouseLeftButtonUp"
                            MouseMove="Canvas_MouseMove"
                            ClipToBounds="True">
                        <Viewbox Name="mainView"
                                 Canvas.Left="0"
                                 Canvas.Top="0">
                            <Canvas x:Name="canvas"
                                    Width="780"
                                    Height="780"
                                    ClipToBounds="True" />
                        </Viewbox>
                    </Canvas>
                    <myuc:ColorMapBar Width="56"
                                      Height="120"
                                      Margin="0,0,5,10"
                                      HorizontalAlignment="Right"
                                      VerticalAlignment="Bottom"
                                      TopDepth="200"
                                      BottomDepth="900"
                                      UcWidth="20" />
                </Grid>
            </md:Card>
            <!--#endregion-->
        </UniformGrid>
        <!--#endregion-->
        <!--#region 事件统计-->
        <Grid Grid.Row="2" Margin="15,30,15,30">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <!--#region 震级-->
            <md:Card Grid.Column="0"
                     Margin="0,0,5,0"
                     md:ThemeAssist.Theme="Light"
                     UniformCornerRadius="5">
                <Grid>
                    <TextBlock Margin="5"
                               Text="震级变化"
                               FontFamily="微软雅黑"
                               FontSize="16" />
                    <lvc:CartesianChart Margin="5,25,5,5">
                        <lvc:CartesianChart.Series>
                            <lvc:LineSeries Stroke="#4a89dc"
                                            Fill="Transparent"
                                            PointGeometrySize="0"
                                            Values="{Binding ListML}" />
                        </lvc:CartesianChart.Series>
                        <lvc:CartesianChart.AxisX>
                            <lvc:Axis MinValue="0"
                                      ShowLabels="True"
                                      MaxValue="20"
                                      Labels="{Binding EventMLLabels}">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Step="5" Stroke="Transparent">
                                    </lvc:Separator>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisX>
                        <lvc:CartesianChart.AxisY>
                            <lvc:Axis MinValue="-4"
                                      MaxValue="0"
                                      ShowLabels="True">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="Transparent" />
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisY>
                    </lvc:CartesianChart>
                </Grid>
            </md:Card>
            <!--#endregion-->

            <!--#region 主频-->
            <md:Card Grid.Column="1"
                     Margin="5,0,5,0"
                     md:ThemeAssist.Theme="Light"
                     UniformCornerRadius="5">
                <Grid>
                    <TextBlock Margin="5"
                               Text="能量变化"
                               FontFamily="微软雅黑"
                               FontSize="16" />
                    <lvc:CartesianChart Margin="5,25,5,5"
                                        Hoverable="False"
                                        DataTooltip="{x:Null}">
                        <lvc:CartesianChart.Series>
                            <lvc:LineSeries Width="1"
                                            Stroke="#d770ad"
                                            Fill="Transparent"
                                            PointGeometrySize="0"
                                            Values="{Binding ListEnergy}" />
                        </lvc:CartesianChart.Series>
                        <lvc:CartesianChart.AxisX>
                            <lvc:Axis MinValue="0"
                                      ShowLabels="True"
                                      MaxValue="20"
                                      Labels="{Binding EventDominantFreqLabels}">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Step="5" Stroke="Transparent">
                                    </lvc:Separator>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisX>
                        <lvc:CartesianChart.AxisY>
                            <lvc:Axis MinValue="0"
                                      MaxValue="{Binding EnergyMaxY}"
                                      ShowLabels="True">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="Transparent" />
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisY>
                    </lvc:CartesianChart>
                </Grid>
            </md:Card>
            <!--#endregion-->

            <!--#region 应力降-->
            <md:Card Grid.Column="2"
                     Margin="5,0,0,0"
                     md:ThemeAssist.Theme="Light"
                     UniformCornerRadius="5">
                <Grid>
                    <TextBlock Margin="5"
                               Text="主频变化"
                               FontFamily="微软雅黑"
                               FontSize="16" />
                    <lvc:CartesianChart Margin="5,25,5,5"
                                        Hoverable="False"
                                        DataTooltip="{x:Null}">
                        <lvc:CartesianChart.Series>
                            <lvc:LineSeries Stroke="#e74c3c"
                                            Fill="Transparent"
                                            PointGeometrySize="0"
                                            Values="{Binding ListDominantFreq}" />
                        </lvc:CartesianChart.Series>
                        <lvc:CartesianChart.AxisX>
                            <lvc:Axis MinValue="0"
                                      ShowLabels="True"
                                      MaxValue="20"
                                      Labels="{Binding EventDominantFreqLabels}">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Step="5" Stroke="Transparent">
                                    </lvc:Separator>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisX>
                        <lvc:CartesianChart.AxisY>
                            <lvc:Axis MinValue="0" ShowLabels="True">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="Transparent" />
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisY>
                    </lvc:CartesianChart>
                </Grid>
            </md:Card>
            <!--#endregion-->
        </Grid>
        <!--#endregion-->
    </Grid>
</UserControl>
