<Window x:Class="NEIntelligentControl2.Windows.PV.SUN2000InfoWindow"
        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:NEIntelligentControl2.Windows.PV"
        mc:Ignorable="d"
             xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             d:DesignHeight="722" d:DesignWidth="1306" Title="SUN2000详情页" Width="1306" Height="649.8" Background="#FF454545" WindowStyle="None" WindowStartupLocation="CenterScreen" MouseLeftButtonDown="Window_MouseLeftButtonDown">
    <WindowChrome.WindowChrome>
        <WindowChrome/>
    </WindowChrome.WindowChrome>
    <Window.Resources>
        <!--内容背景-->
        <SolidColorBrush x:Key="ContentBackground" Color="#FF232D38"/>

        <ControlTemplate x:Key="ScrollViewerTemplate" TargetType="{x:Type ScrollViewer}">
            <!--View区域背景色-->
            <Grid x:Name="Grid" Background="{TemplateBinding Background}">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Rectangle x:Name="Corner" Grid.Column="1" Fill="White" Grid.Row="1"/>
                <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Grid.Column="0" Margin="{TemplateBinding Padding}" Grid.Row="0"/>
                <ScrollBar x:Name="PART_VerticalScrollBar" AutomationProperties.AutomationId="VerticalScrollBar" Cursor="Arrow" Grid.Column="1" Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" Grid.Row="0" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" Style="{DynamicResource MyScrollBarStyle}"/>
                <ScrollBar x:Name="PART_HorizontalScrollBar" AutomationProperties.AutomationId="HorizontalScrollBar" Cursor="Arrow" Grid.Column="0" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Orientation="Horizontal" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"  Style="{DynamicResource MyScrollBarStyle}"/>
            </Grid>
        </ControlTemplate>


        <SolidColorBrush x:Key="ScrollBarDisabledBackground" Color="#7FF4F4F4"/>

        <Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!--滚动条颜色、圆角等设置-->
        <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Thumb}">
                        <!--滚动条颜色和圆角设置-->
                        <Rectangle Name="thumbRect" Fill="#FFB1B1B1" RadiusX="3" RadiusY="3"/>
                        <!--鼠标拉动滚动条时的颜色-->
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Fill" Value="CornflowerBlue" TargetName="thumbRect" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
            <Setter Property="OverridesDefaultStyle" Value="true"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Focusable" Value="false"/>
            <Setter Property="IsTabStop" Value="false"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type RepeatButton}">
                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="MyScrollBarStyle" TargetType="{x:Type ScrollBar}">
            <Setter Property="Background" Value="#77F0F8FF"/>
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
            <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
            <!--滚动条宽度-->
            <Setter Property="Width" Value="8"/>
            <Setter Property="MinWidth" Value="6"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ScrollBar}">
                        <!--滚动条背景色-->
                        <Grid x:Name="Bg" Background="#77DDDDDD" SnapsToDevicePixels="true" Width="8">
                            <Grid.RowDefinitions>
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}">
                                <Track.DecreaseRepeatButton>
                                    <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
                                </Track.DecreaseRepeatButton>
                                <Track.IncreaseRepeatButton>
                                    <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource VerticalScrollBarPageButton}"/>
                                </Track.IncreaseRepeatButton>
                                <Track.Thumb>
                                    <Thumb Style="{StaticResource ScrollBarThumb}"/>
                                </Track.Thumb>
                            </Track>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Width" Value="Auto"/>
                    <Setter Property="MinWidth" Value="0"/>
                    <Setter Property="Height" Value="6"/>
                    <Setter Property="MinHeight" Value="6"/>
                    <Setter Property="Background" Value="#77F0F8FF"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ScrollBar}">
                                <Grid x:Name="Bg" Background="Red" SnapsToDevicePixels="true">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Track x:Name="PART_Track"  IsEnabled="{TemplateBinding IsMouseOver}">
                                        <Track.DecreaseRepeatButton>
                                            <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
                                        </Track.DecreaseRepeatButton>
                                        <Track.IncreaseRepeatButton>
                                            <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource HorizontalScrollBarPageButton}"/>
                                        </Track.IncreaseRepeatButton>
                                        <Track.Thumb>
                                            <Thumb Style="{StaticResource ScrollBarThumb}" />
                                        </Track.Thumb>
                                    </Track>
                                </Grid>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsEnabled" Value="false">
                                        <Setter Property="Background" TargetName="Bg" Value="{StaticResource ScrollBarDisabledBackground}"/>
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=PVName}" Foreground="WhiteSmoke" HorizontalAlignment="Center" Margin="0,5"/>
        <Button Height="25" Width="51.8" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="3,0" BorderBrush="{x:Null}" Foreground="{x:Null}" Padding="0,0,0,0" BorderThickness="0,0,0,0" Background="{x:Null}" Click="Button_Click" WindowChrome.IsHitTestVisibleInChrome="True">
            <Image Source="pack://application:,,,/智动启停;component/Images/PV/close.png"/>
        </Button>

        <Border Background="#FF19222A" CornerRadius="7" Grid.Row="1" Margin="5">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="4*"/>
                </Grid.ColumnDefinitions>
                <ScrollViewer Margin="5" Template="{DynamicResource ScrollViewerTemplate}" VerticalScrollBarVisibility="Auto">
                    <StackPanel x:Name="_SPMain">
                        <Border CornerRadius="7" Background="{StaticResource ContentBackground}">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="1.2*"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="名称" Foreground="#FFD4D4D4" HorizontalAlignment="Left" FontSize="17" VerticalAlignment="Center" Margin="10"/>
                                <Border Grid.Column="1" Background="#02FFFFFF" MouseLeftButtonUp="Border_MouseLeftButtonUp" Tag="p">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="功率/kW" Foreground="#FFD4D4D4" HorizontalAlignment="Center" FontSize="16" VerticalAlignment="Center" Margin="3,10,3,10"/>
                                        <StackPanel x:Name="_SPP" Orientation="Horizontal" Visibility="Collapsed">
                                            <Viewbox Width="20" Height="20">
                                                <Viewbox.Style>
                                                    <Style TargetType="Viewbox">
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="False">
                                                                <Setter Property="Visibility" Value="Visible"/>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="True">
                                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Viewbox.Style>
                                                <Canvas Width="1024" Height="1024">
                                                    <Path Fill="WhiteSmoke" Data="M910.222222 796.444444c-17.066667 0-34.133333-5.688889-45.511111-17.066666L551.822222 409.6c-11.377778-5.688889-17.066667-11.377778-34.133333-11.377778-5.688889 0-22.755556 5.688889-28.444445 11.377778l-329.955555 364.088889c-22.755556 22.755556-56.888889 22.755556-79.644445 5.688889-22.755556-22.755556-22.755556-56.888889-5.688888-79.644445l329.955555-364.088889c28.444444-34.133333 73.955556-51.2 119.466667-51.2s85.333333 22.755556 119.466666 56.888889l312.888889 364.088889c22.755556 22.755556 17.066667 56.888889-5.688889 79.644445-11.377778 5.688889-28.444444 11.377778-39.822222 11.377777z"/>
                                                </Canvas>
                                            </Viewbox>
                                            <Viewbox Width="20" Height="20">
                                                <Viewbox.Style>
                                                    <Style TargetType="Viewbox">
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="True">
                                                                <Setter Property="Visibility" Value="Visible"/>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="False">
                                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Viewbox.Style>
                                                <Canvas Width="1024" Height="1024">
                                                    <Path Fill="WhiteSmoke" Data="M517.688889 796.444444c-45.511111 0-85.333333-17.066667-119.466667-51.2L73.955556 381.155556c-22.755556-22.755556-17.066667-56.888889 5.688888-79.644445 22.755556-22.755556 56.888889-17.066667 79.644445 5.688889l329.955555 364.088889c5.688889 5.688889 17.066667 11.377778 28.444445 11.377778s22.755556-5.688889 34.133333-17.066667l312.888889-364.088889c22.755556-22.755556 56.888889-28.444444 79.644445-5.688889 22.755556 22.755556 28.444444 56.888889 5.688888 79.644445L637.155556 739.555556c-28.444444 39.822222-68.266667 56.888889-119.466667 56.888888 5.688889 0 0 0 0 0z"/>
                                                </Canvas>
                                            </Viewbox>
                                        </StackPanel>
                                        <Viewbox Width="17" Height="17">
                                            <Viewbox.Style>
                                                <Style TargetType="Viewbox">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding ElementName=__SPP, Path=Visibility}" Value="Visible">
                                                            <Setter Property="Visibility" Value="Collapsed"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Viewbox.Style>
                                            <Canvas Width="1024" Height="1024">
                                                <Path Fill="WhiteSmoke" Data="M884.363 558.534H139.636c-51.205 0-63.477 29.636-27.272 65.863L446.182 958.17c36.205 36.228 95.432 36.228 131.637 0l333.818-333.772c36.204-36.228 23.931-65.864-27.274-65.864zM139.636 465.443h744.727c51.205 0 63.478-29.614 27.273-65.818L577.818 65.829c-36.205-36.205-95.432-36.205-131.637 0L112.364 399.625c-36.205 36.204-23.932 65.818 27.272 65.818z"/>
                                            </Canvas>
                                        </Viewbox>
                                    </StackPanel>
                                </Border>
                                <Border Grid.Column="2" Background="#02FFFFFF" MouseLeftButtonUp="Border_MouseLeftButtonUp" Tag="i">
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="ΔI/A" Foreground="#FFD4D4D4" HorizontalAlignment="Center" FontSize="17" VerticalAlignment="Center" Margin="3,10,3,10"/>
                                        <StackPanel x:Name="_SPI" Orientation="Horizontal" Visibility="Collapsed">
                                            <Viewbox Width="20" Height="20">
                                                <Viewbox.Style>
                                                    <Style TargetType="Viewbox">
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="False">
                                                                <Setter Property="Visibility" Value="Visible"/>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="True">
                                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Viewbox.Style>
                                                <Canvas Width="1024" Height="1024">
                                                    <Path Fill="WhiteSmoke" Data="M910.222222 796.444444c-17.066667 0-34.133333-5.688889-45.511111-17.066666L551.822222 409.6c-11.377778-5.688889-17.066667-11.377778-34.133333-11.377778-5.688889 0-22.755556 5.688889-28.444445 11.377778l-329.955555 364.088889c-22.755556 22.755556-56.888889 22.755556-79.644445 5.688889-22.755556-22.755556-22.755556-56.888889-5.688888-79.644445l329.955555-364.088889c28.444444-34.133333 73.955556-51.2 119.466667-51.2s85.333333 22.755556 119.466666 56.888889l312.888889 364.088889c22.755556 22.755556 17.066667 56.888889-5.688889 79.644445-11.377778 5.688889-28.444444 11.377778-39.822222 11.377777z"/>
                                                </Canvas>
                                            </Viewbox>
                                            <Viewbox Width="20" Height="20">
                                                <Viewbox.Style>
                                                    <Style TargetType="Viewbox">
                                                        <Style.Triggers>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="True">
                                                                <Setter Property="Visibility" Value="Visible"/>
                                                            </DataTrigger>
                                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}, Path=IsForwardSort}" Value="False">
                                                                <Setter Property="Visibility" Value="Collapsed"/>
                                                            </DataTrigger>
                                                        </Style.Triggers>
                                                    </Style>
                                                </Viewbox.Style>
                                                <Canvas Width="1024" Height="1024">
                                                    <Path Fill="WhiteSmoke" Data="M517.688889 796.444444c-45.511111 0-85.333333-17.066667-119.466667-51.2L73.955556 381.155556c-22.755556-22.755556-17.066667-56.888889 5.688888-79.644445 22.755556-22.755556 56.888889-17.066667 79.644445 5.688889l329.955555 364.088889c5.688889 5.688889 17.066667 11.377778 28.444445 11.377778s22.755556-5.688889 34.133333-17.066667l312.888889-364.088889c22.755556-22.755556 56.888889-28.444444 79.644445-5.688889 22.755556 22.755556 28.444444 56.888889 5.688888 79.644445L637.155556 739.555556c-28.444444 39.822222-68.266667 56.888889-119.466667 56.888888 5.688889 0 0 0 0 0z"/>
                                                </Canvas>
                                            </Viewbox>
                                        </StackPanel>
                                        <Viewbox Width="17" Height="17">
                                            <Viewbox.Style>
                                                <Style TargetType="Viewbox">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding ElementName=_SPI, Path=Visibility}" Value="Visible">
                                                            <Setter Property="Visibility" Value="Collapsed"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Viewbox.Style>
                                            <Canvas Width="1024" Height="1024">
                                                <Path Fill="WhiteSmoke" Data="M884.363 558.534H139.636c-51.205 0-63.477 29.636-27.272 65.863L446.182 958.17c36.205 36.228 95.432 36.228 131.637 0l333.818-333.772c36.204-36.228 23.931-65.864-27.274-65.864zM139.636 465.443h744.727c51.205 0 63.478-29.614 27.273-65.818L577.818 65.829c-36.205-36.205-95.432-36.205-131.637 0L112.364 399.625c-36.205 36.204-23.932 65.818 27.272 65.818z"/>
                                            </Canvas>
                                        </Viewbox>
                                    </StackPanel>
                                </Border>
                            </Grid>
                        </Border>
                    </StackPanel>
                </ScrollViewer>
                <Border Grid.Column="1" CornerRadius="7" Background="{StaticResource ContentBackground}" Margin="5">
                    <lvc:CartesianChart x:Name="_Chart" Margin="5" LegendLocation="Bottom" Foreground="#FFD4D4D4">
                        <lvc:CartesianChart.AxisX>
                            <lvc:Axis x:Name="_ChartAxisX">
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="{x:Null}"/>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisX>
                        <lvc:CartesianChart.AxisY>
                            <lvc:Axis>
                                <lvc:Axis.Separator>
                                    <lvc:Separator Stroke="#FF2B3744"/>
                                </lvc:Axis.Separator>
                            </lvc:Axis>
                        </lvc:CartesianChart.AxisY>

                        <lvc:CartesianChart.DataTooltip>
                            <lvc:DefaultTooltip Background="#CC2B4056" CornerRadius="7"/>
                        </lvc:CartesianChart.DataTooltip>

                        <lvc:CartesianChart.Series>
                            <lvc:LineSeries Title="ΔI" x:Name="_LineChartI" PointForeground="{StaticResource ContentBackground}" PointGeometry="{x:Null}">
                                <lvc:LineSeries.Fill>
                                    <SolidColorBrush Color="#00F34336"/>
                                </lvc:LineSeries.Fill>
                                <lvc:LineSeries.Stroke>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <LinearGradientBrush.RelativeTransform>
                                            <TransformGroup>
                                                <ScaleTransform CenterY="0.5" CenterX="0.5"/>
                                                <SkewTransform CenterY="0.5" CenterX="0.5"/>
                                                <RotateTransform Angle="90" CenterY="0.5" CenterX="0.5"/>
                                                <TranslateTransform/>
                                            </TransformGroup>
                                        </LinearGradientBrush.RelativeTransform>
                                        <GradientStop Color="#FF2772E3" Offset="0"/>
                                        <GradientStop Color="#FF4B94F8" Offset="1"/>
                                    </LinearGradientBrush>
                                </lvc:LineSeries.Stroke>
                            </lvc:LineSeries>
                        </lvc:CartesianChart.Series>
                    </lvc:CartesianChart>
                </Border>
            </Grid>
        </Border>
    </Grid>
</Window>
