<Window x:Class="NEIntelligentControl2.Windows.RecomendWindow"
        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"
             xmlns:basic="clr-namespace:NEIntelligentControl2.Views.Basic"
        mc:Ignorable="d"
        Title="启停推荐" Height="850" Width="1806" Background="#FF434343" WindowStyle="None" WindowStartupLocation="CenterOwner" Closing="Window_Closing" Loaded="Window_Loaded">
    <WindowChrome.WindowChrome>
        <WindowChrome/>
    </WindowChrome.WindowChrome>
    <Window.Resources>
        <ItemsPanelTemplate x:Key="ItemsPanelTemplateMian">
            <VirtualizingStackPanel IsItemsHost="True" Orientation="Horizontal"/>
        </ItemsPanelTemplate>
        
        <Style x:Key="ConfirmButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="#FF006ACC"/>
            <Setter Property="Foreground" Value="WhiteSmoke"/>
            <Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Padding" Value="17,6"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Margin" Value="20,0"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border x:Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="true" CornerRadius="3">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="true">
                                <Setter Property="Background" TargetName="border" Value="#FF2E81CC"/>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="true">
                                <Setter Property="Background" TargetName="border" Value="#FF006ACC"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>


        <Style 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="#77F0F8FF" 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.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <ListBox Grid.Row="1" x:Name="_LBOperation" SelectedIndex="0" SelectionChanged="_LBOperation_SelectionChanged" Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0,0,0,0">
            <ListBoxItem Tag="all">
                <Grid Margin="10" Width="170">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Width="24" Height="24" Source="pack://application:,,,/智动启停;component/Images/Remomend/calc_all.png"/>
                    <TextBlock Text="全部" Grid.Column="1" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                    <TextBlock x:Name="_TBAll" Text="0" Grid.Column="2" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                </Grid>
            </ListBoxItem>

            <ListBoxItem Tag="Start">
                <Grid Margin="10" Width="170">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Width="24" Height="24" Source="pack://application:,,,/智动启停;component/Images/Remomend/calc_startr.png"/>
                    <TextBlock Text="待启动" Grid.Column="1" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                    <TextBlock x:Name="_TBStart" Text="0" Grid.Column="2" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                </Grid>
            </ListBoxItem>
            <ListBoxItem Tag="Stop">
                <Grid Margin="10" Width="170">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Width="24" Height="24" Source="pack://application:,,,/智动启停;component/Images/Remomend/calc_stop.png"/>
                    <TextBlock Text="待停机" Grid.Column="1" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                    <TextBlock x:Name="_TBStop" Text="0" Grid.Column="2" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                </Grid>
            </ListBoxItem>
            <ListBoxItem Tag="Reset">
                <Grid Margin="10" Width="170">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Width="24" Height="24" Source="pack://application:,,,/智动启停;component/Images/Remomend/calc_reset.png"/>
                    <TextBlock Text="待复位" Grid.Column="1" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                    <TextBlock x:Name="_TBReset" Text="0" Grid.Column="2" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                </Grid>
            </ListBoxItem>
            <ListBoxItem Tag="Maintain">
                <Grid Margin="10" Width="170">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Width="24" Height="24" Source="pack://application:,,,/智动启停;component/Images/Remomend/calc_maintain.png"/>
                    <TextBlock Text="待维护" Grid.Column="1" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                    <TextBlock x:Name="_TBMaintain" Text="0" Grid.Column="2" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                </Grid>
            </ListBoxItem>
            <ListBoxItem Tag="UnMaintain">
                <Grid Margin="10" Width="170">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="3*"/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <Image Width="24" Height="24" Source="pack://application:,,,/智动启停;component/Images/Remomend/calc_unmaintian.png"/>
                    <TextBlock Text="待取消维护" Grid.Column="1" Foreground="WhiteSmoke" FontSize="16" Margin="5,0"/>
                    <TextBlock x:Name="_TBUnMaintain" Text="0" Grid.Column="2" Foreground="WhiteSmoke" FontSize="16" Margin="12,0"/>
                </Grid>
            </ListBoxItem>
        </ListBox>


        <ListBox x:Name="_LBMain" DisplayMemberPath="Name" SelectionChanged="_LBMain_SelectionChanged" Margin="5" Foreground="WhiteSmoke" FontSize="16" ItemsPanel="{StaticResource ItemsPanelTemplateMian}" Grid.Column="1" Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0,0,0,0" Height="33" VerticalAlignment="Bottom" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Hidden" WindowChrome.IsHitTestVisibleInChrome="True"/>


        <Grid Grid.Column="1" Grid.Row="1" Margin="0,0,10,10">
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Border CornerRadius="7" Background="WhiteSmoke" Margin="0,5">
                <ScrollViewer Margin="5">
                    <basic:OptionalUniformGrid x:Name="_OPUGMain" Columns="9" MinHeight="70"/>
                </ScrollViewer>
            </Border>
            <StackPanel Grid.Row="1" Background="WhiteSmoke">
                <Button Content="发 送" HorizontalAlignment="Right" Margin="20,5" Padding="17,3" FontSize="14" Style="{DynamicResource ConfirmButtonStyle}" Click="Button_Click" Tag="send"/>
            </StackPanel>
        </Grid>

        <Button Grid.ColumnSpan="2" 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_1" WindowChrome.IsHitTestVisibleInChrome="True">
            <Image Source="pack://application:,,,/智动启停;component/Images/PV/close.png"/>
        </Button>

    </Grid>
</Window>
