<UserControl x:Class="VIZ.TVP.CBA.Module.TeamStatsView"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                      xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                      xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
                      xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm"
                      xmlns:dxrudex="http://schemas.devexpress.com/winfx/2008/xaml/reports/userdesignerextensions"
                      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                      xmlns:core="clr-namespace:VIZ.Framework.Core;assembly=VIZ.Framework.Core"
                      xmlns:storage="clr-namespace:VIZ.TVP.CBA.Module"
             mc:Ignorable="d"
             d:DesignHeight="800" d:DesignWidth="650" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/VIZ.TVP.CBA.Module;component/Style/DataGrid.xaml"></ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>

            <core:Enum2EnumDescriptionConverter x:Key="Enum2EnumDescriptionConverter" EnumType="{x:Type storage:HighLightEnum}"></core:Enum2EnumDescriptionConverter>

            <core:Enum2EnumDescriptionConverter x:Key="TechStatsEnumDescriptionConverter" EnumType="{x:Type storage:TechStats}"></core:Enum2EnumDescriptionConverter>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="150"/>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>


        <!--<WrapPanel  Grid.Row="0" VerticalAlignment="Center">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="280"/>
                    <ColumnDefinition Width="100"/>
                </Grid.ColumnDefinitions>

                <TextBlock Text="比赛日期:" Grid.Column="0" FontSize="16"  HorizontalAlignment="Center" VerticalAlignment="Center"/>

                <dxe:DateEdit Grid.Column="1" HorizontalAlignment="Center" Name="Date_MatchDateInfo" Width="120" 
                              EditValue="{Binding MatchDate,Mode=TwoWay}" FontSize="16"     ShowToday="False" ShowClearButton="False"  
                                  VerticalAlignment="Center"  MaskUseAsDisplayFormat="True" >
                </dxe:DateEdit>

                <TextBlock Text="赛程:" Grid.Column="2" FontSize="16"  HorizontalAlignment="Center" VerticalAlignment="Center"/>

                <dxe:ComboBoxEdit Grid.Column="3"    HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16"
                          Width="280" ItemsSource="{Binding Path=MatchItems,Mode=TwoWay}" 
                          SelectedItem="{Binding Path=SelectMatchItems,Mode=TwoWay}" >
                </dxe:ComboBoxEdit>

                <TextBox Grid.Column="4" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding MatchStatus,Mode=TwoWay}" Width="80"/>

            </Grid>
        </WrapPanel>-->


        <WrapPanel Grid.Row="1"   VerticalAlignment="Center" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="75"/>
                    <ColumnDefinition Width="130"/>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="40"/>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="100"/>
                  
                    <!--<ColumnDefinition Width="110"/>
                    <ColumnDefinition Width="110"/>-->
                </Grid.ColumnDefinitions>
                <!--{Binding HomeTeam}-->

                <TextBlock Grid.Column="0" Text="标题："  FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center"/>

                <dxe:TextEdit  Grid.Column="1" Width="120"  FontSize="16"   HorizontalContentAlignment="Center" 
                          VerticalAlignment="Center"  Text="{Binding Title,Mode=TwoWay }"   />

                <dxe:TextEdit Text="{Binding HomeTeam}" Grid.Column="2" Width="120" HorizontalAlignment="Center" VerticalAlignment="Center"  FontSize="16"/>

                <TextBlock  TextBlock.TextAlignment="Center" Text="VS" Width="60" Grid.Column="3"  FontSize="16"  HorizontalAlignment="Center" VerticalAlignment="Center"/>
                <dxe:TextEdit Text="{Binding AwayTeam}"  Grid.Column="4" Width="120"  FontSize="16"  HorizontalAlignment="Center" VerticalAlignment="Center"/>


                <TextBlock  Grid.Column="5" TextBlock.TextAlignment="Center" Text="项数:" Width="45"  FontSize="16"   HorizontalAlignment="Right" VerticalAlignment="Center" />
                <dxe:ComboBoxEdit  Grid.Column="6" x:Name="com_matchStatsId"  HorizontalAlignment="Center" VerticalAlignment="Center" Width="80" FontSize="16" 
                          ItemsSource="{Binding Path=MatchStatsIds,Mode=TwoWay}"
                          SelectedItem="{Binding Path=MatchStatsId,Mode=TwoWay}" >
                </dxe:ComboBoxEdit>
                <!--<Button Content="刷新" Command="{Binding BtnCommand}" HorizontalContentAlignment="Center"  
                              Grid.Column="6" Width="95" Height="30"  FontSize="14"/>
                <Button Content="上数据" Command="{Binding BtnCmdUpData}" HorizontalContentAlignment="Center"  
                              Grid.Column="7" Width="95" Height="30"  FontSize="14"/>-->
            </Grid>
        </WrapPanel>

        <WrapPanel Grid.Row="2" Margin="190,0,0,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="150"/>
                    <ColumnDefinition  Width="200"/>
                </Grid.ColumnDefinitions>

                <dxe:ImageEdit Grid.Column="0" Height="150" Width="120" x:Name="Home_TeamLogo" ShowMenu="False" EditValue="{Binding Path=HomeTeamLogo}"  
                               ShowLoadDialogOnClickMode="Never"/>
                <dxe:ImageEdit Grid.Column="1" Height="150" Width="120" x:Name="Away_TeamLogo" ShowMenu="False" EditValue="{Binding Path=AwayTeamLogo}" 
                               ShowLoadDialogOnClickMode="Never" Margin="-25,0,0,0"/>
            </Grid>
            
        </WrapPanel>

        <WrapPanel Grid.Row="3"   VerticalAlignment="Center" HorizontalAlignment="Left" >
            <Grid>
                <Grid.ColumnDefinitions>

                    <ColumnDefinition Width="110"/>
                    <ColumnDefinition Width="110"/>
                    <ColumnDefinition Width="110"/>
                    <ColumnDefinition Width="110"/>
                </Grid.ColumnDefinitions>
                <!--{Binding HomeTeam}-->


                <Button Content="刷新" Command="{Binding BtnCommand}" HorizontalContentAlignment="Center"  
                              Grid.Column="0" Width="95" Height="30"  FontSize="14"/>

                <Button  Content="任务开始"  Name="task_Start" Click="task_Start_Click" Grid.Column="1" FontSize="14" Height="30" Width="90"/>

                <Button  Content="任务暂停"  Name="task_continue" Click="task_continue_Click" Grid.Column="2" FontSize="14" Height="30" Width="90"/>

                <Button  Content="任务停止"  Name="task_Stop" Click="task_Stop_Click" Grid.Column="3" FontSize="14" Height="30" Width="90"/>
                <!--<Button Content="上数据" Command="{Binding BtnCmdUpData}" HorizontalContentAlignment="Center"  
                              Grid.Column="1" Width="95" Height="30"  FontSize="14"/>-->
            </Grid>
        </WrapPanel>


        <!--<DataGrid AutoGenerateColumns="False" CanUserAddRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False"
                      ItemsSource="{Binding Path=MatchStatsNumbers}"  Grid.Row="1" Background="Black"  RowHeaderWidth="0" >
            <DataGrid.ColumnHeaderStyle>
                <Style TargetType="DataGridColumnHeader">
                    <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
                    <Setter Property="Background" Value="Black"></Setter>
                    <Setter Property="Foreground" Value="White"></Setter>
                    <Setter Property="BorderThickness" Value="1"></Setter>
                    <Setter Property="FontSize" Value="20"/>
                </Style>
            </DataGrid.ColumnHeaderStyle>

            <DataGrid.Columns>
                <DataGridComboBoxColumn Header="" Width="100"           SelectedItemBinding="{Binding Path=Light,Mode=TwoWay,Converter={StaticResource Enum2EnumDescriptionConverter}}"
                                        ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.EnumDescriptions}}"
                                        CellStyle="{StaticResource  DataGirdView_UI}" >
                </DataGridComboBoxColumn>
                <DataGridTextColumn Header="主队本场" Width="*" Binding="{Binding Path=HomeScore}" CellStyle="{StaticResource  DataGirdView_UI}" ></DataGridTextColumn>
                <DataGridTextColumn Header="主队赛季" Width="*" Binding="{Binding Path=HSeasonScore}"  CellStyle="{StaticResource  DataGirdView_UI}"></DataGridTextColumn>

                <DataGridComboBoxColumn Header="" Width="100" 
                                        
                                        SelectedItemBinding="{Binding Path=TechStats,Mode=TwoWay,Converter={StaticResource TechStatsEnumDescriptionConverter},UpdateSourceTrigger=PropertyChanged}"
                                        ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.EnumTechStatsDescriptions}}"
                                        
                                        CellStyle="{StaticResource  DataGirdView_UI}" >

                    <DataGridComboBoxColumn.EditingElementStyle>
                        <Style TargetType="ComboBox">
                            <EventSetter Event="SelectionChanged" Handler="ComboBox_SelectionChanged_1"/>
                            -->
        <!--<Setter Property="Background" Value="Red"/>-->
        <!--
                        </Style>
                    </DataGridComboBoxColumn.EditingElementStyle>
                </DataGridComboBoxColumn>
                <DataGridTextColumn Header="客队本场" Width="*" Binding="{Binding Path=AwayScore}"  CellStyle="{StaticResource  DataGirdView_UI}"></DataGridTextColumn>
                <DataGridTextColumn Header="客队赛季" Width="*" Binding="{Binding Path=ASeasonScore}"  CellStyle="{StaticResource  DataGirdView_UI}"></DataGridTextColumn>
              
            </DataGrid.Columns>

        </DataGrid>-->



        <DockPanel  Grid.Row="4">
            <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                      VerticalScrollBarVisibility="Auto"
                      Name="PART_Options"
                      DockPanel.Dock="Right"
                      dx:ScrollBarExtensions.ScrollBarMode="TouchOverlap"
                      Focusable="False">

            </ScrollViewer>
            <dxg:GridControl x:Name="grid" ShowBorder="False" ItemsSource="{Binding Path= MatchStatsNumbers,Mode=TwoWay}">
                <dxg:GridColumn FieldName="SelectLight"  Header="" Width="112">
                    <dxg:GridColumn.EditSettings>
                        <dxe:ComboBoxEditSettings 
                                        ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.EnumDescriptions}}" IsTextEditable="False" />
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>
                <dxg:GridColumn FieldName="HomeScore"  Header="主队本场" Width="112"  />
                <dxg:GridColumn FieldName="HSeasonScore"  Header="主队赛季" Width="112"    />

                <dxg:GridColumn FieldName="TechStatsName"  Header="" Width="112">
                    <dxg:GridColumn.EditSettings>
                        <dxe:ComboBoxEditSettings 
                                        ItemsSource="{Binding Source={x:Static Member=storage:StaticEnumInfos.EnumTechStatsDescriptions}}" IsTextEditable="False" />
                    </dxg:GridColumn.EditSettings>
                </dxg:GridColumn>

                <dxg:GridColumn FieldName="AwayScore"  Header="客队本场" Width="112"  />
                <dxg:GridColumn FieldName="ASeasonScore"  Header="客队赛季" Width="112"    />

                <!--#endregion-->
                <dxg:GridControl.View>
                    <dxg:TableView AutoWidth="True"  ShowGroupPanel="False" 
                               BorderThickness="0"  
                               ShowFilterPanelMode="Never" 
                               AllowColumnFiltering="False"
                               AllowSorting="False"
                               IsColumnMenuEnabled="False"   >
                    </dxg:TableView>
                </dxg:GridControl.View>
            </dxg:GridControl>
        </DockPanel>
    </Grid>
</UserControl>
