<UserControl x:Class="VIZ.TVP.CBA.Module.SinglePlayerView"
             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="40"/>
            <RowDefinition Height="160"/>
            <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="2"  VerticalAlignment="Center"  >
            <Grid>
                <Grid.ColumnDefinitions>
                    <!--<ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="120"/>-->

                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="120"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="80"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="50"/>
                    <ColumnDefinition Width="80"/>
                </Grid.ColumnDefinitions>

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

                <dxe:TextEdit Grid.Column="1"   Width="120"  FontSize="16"   HorizontalContentAlignment="Center" 
                         HorizontalAlignment="Left" VerticalAlignment="Center"  Text="{Binding Title,Mode=TwoWay }"></dxe:TextEdit>-->
                <TextBlock Grid.Column="0" Text="球队："  FontSize="16"  VerticalAlignment="Center" HorizontalAlignment="Right"/>

                <dxe:ComboBoxEdit  Grid.Column="1"  Name="com_TeamItem" Width="120"  HorizontalAlignment="Center" VerticalAlignment="Center" 
                          ItemsSource="{Binding Path=TeamItems,Mode=TwoWay}" SelectedItem="{Binding Path=SelectTeamItem,Mode=TwoWay}" SelectedIndex="{Binding SelectedIndex}"
                          FontSize="16">
                </dxe:ComboBoxEdit>

                <TextBlock Text="球员：" Grid.Column="2"  VerticalAlignment="Center" HorizontalAlignment="Right"  FontSize="16" />

                <dxe:ComboBoxEdit  Grid.Column="3" x:Name="com_players"  HorizontalAlignment="Center" VerticalAlignment="Center" Width="80"
                          ItemsSource="{Binding Path=PlayerItems,Mode=TwoWay}"
                          SelectedItem="{Binding Path=SelectPlayer,Mode=TwoWay}"  FontSize="16" />

                <TextBlock Text="球衣号:" Grid.Column="4"  VerticalAlignment="Center" HorizontalAlignment="Right"  FontSize="16" />

                <dxe:TextEdit Text="{Binding PlayNum,Mode=TwoWay}" Grid.Column="5"  VerticalAlignment="Center" HorizontalAlignment="Right"  FontSize="16" Width="50" ></dxe:TextEdit>

                <TextBlock Text="项数:" Grid.Column="6"   VerticalAlignment="Center" HorizontalAlignment="Right"  FontSize="16" />

                <dxe:ComboBoxEdit  Grid.Column="7" x:Name="com_matchStatsId" HorizontalAlignment="Center" VerticalAlignment="Center" Width="80"
                          ItemsSource="{Binding Path=MatchStatsIds,Mode=TwoWay}"
                          SelectedItem="{Binding Path=MatchStatsId,Mode=TwoWay}" FontSize="16">
                </dxe:ComboBoxEdit>
                <!--<Button Content="刷新" Command="{Binding BtnCmd}" HorizontalContentAlignment="Center"  
                              Grid.Column="10" Width="95" Height="40"  FontSize="16"/>
                <Button Content="单人球员" Command="{Binding SingleCommand}" HorizontalContentAlignment="Center"  
                              Grid.Column="11" Width="95" Height="40"  FontSize="16"/>
                <Button Content="MVP球员" Command="{Binding MVPCommand}" HorizontalContentAlignment="Center"  
                              Grid.Column="12" Width="95" Height="40"  FontSize="16"/>-->


            </Grid>
        </WrapPanel>

        <WrapPanel Grid.Row="1"  HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Center">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="65"/>
                    <ColumnDefinition Width="130"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="110"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                </Grid.ColumnDefinitions>

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

                <dxe:TextEdit Grid.Column="1"   Width="120"  FontSize="16"   HorizontalContentAlignment="Center" 
                         HorizontalAlignment="Left" VerticalAlignment="Center"  Text="{Binding Title,Mode=TwoWay }"></dxe:TextEdit>
                <Button Content="刷新" Command="{Binding BtnCmd}" HorizontalContentAlignment="Center"  
                              Grid.Column="2" Width="95" Height="30"  FontSize="14"/>


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

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

                <Button  Content="任务停止"  Name="task_Stop" Click="task_Stop_Click" Grid.Column="5" FontSize="14" Height="30" Width="90"/>

                <!--<Button Content="单人球员" Command="{Binding SingleCommand}" HorizontalContentAlignment="Center"  
                              Grid.Column="3" Width="95" Height="30"  FontSize="14"/>
                <Button Content="MVP球员" Command="{Binding MVPCommand}" HorizontalContentAlignment="Center"  
                              Grid.Column="4" Width="95" Height="30"  FontSize="14"/>-->


            </Grid>
        </WrapPanel>

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

                <dxe:ImageEdit Grid.Column="0" Height="150" Width="120" x:Name="Player_Logo" ShowMenu="False" EditValue="{Binding Path=PlayerLogo}"  
                               ShowLoadDialogOnClickMode="Never" Margin="0,0,0,10"/>
                <!--<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>

        <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= SinglePlayerData,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="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="Score"  Header="本场" Width="112"  />
                <dxg:GridColumn FieldName="SeasonScore"  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.RowStyle>
                            <Style   TargetType="{x:Type dxg:RowControl}" >
                                <Setter Property="Visibility" Value="{Binding IsVisiblity,Mode=TwoWay}"/>
                            </Style>
                        </dxg:TableView.RowStyle>-->
                    </dxg:TableView>
                    
                    
                </dxg:GridControl.View>

            </dxg:GridControl>
        </DockPanel>
    </Grid>
</UserControl>
