<UserControl
    x:Class="Client.View.EditTimeSheetsView"
    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:local="clr-namespace:Client.View"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DesignHeight="550"
    d:DesignWidth="800"
    mc:Ignorable="d">
    <Grid>
        <Rectangle
            Grid.Row="0"
            Grid.Column="0"
            Height="50"
            Margin="0,0,0,0"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top">
            <Rectangle.Fill>
                <LinearGradientBrush MappingMode="RelativeToBoundingBox" StartPoint="0.5,0" EndPoint="0.5,1">
                    <GradientStop Color="#FF065393" />
                    <GradientStop Offset="1" Color="#FF1D507A" />
                </LinearGradientBrush>
            </Rectangle.Fill>
        </Rectangle>
        <Label
            Grid.Row="2"
            Grid.Column="1"
            Margin="30,5,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Center"
            VerticalContentAlignment="Center"
            Content="EDITACE PRACOVNÍCH VÝKAZŮ"
            FontSize="24"
            FontWeight="Bold"
            Foreground="White" />
        <Button
            Grid.Row="1"
            Width="230"
            Height="40"
            Margin="0,5,200,0"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Center"
            Background="#FF10BCE2"
            BorderBrush="#FF24334D"
            BorderThickness="0"
            Command="{Binding GenerateTimeSheetsCommand}"
            Content="VYGENEROVAT Z DOCHÁZKY"
            FontSize="16"
            FontWeight="Bold"
            Foreground="White" />

        <ComboBox
            Width="150"
            Height="40"
            Margin="0,5,30,0"
            HorizontalAlignment="Right"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Left"
            VerticalContentAlignment="Center"
            Background="Blue"
            DisplayMemberPath="DisplayName"
            FontSize="18"
            ItemsSource="{Binding Path=MonthComboBoxItems}"
            SelectedItem="{Binding Path=SelectedMonthComboBoxItem}" />
        <Rectangle
            Grid.Row="2"
            Grid.Column="1"
            Grid.ColumnSpan="3"
            MinHeight="400"
            Margin="0,50,0,0"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Fill="#FFD6DFE1">
            <Rectangle.BitmapEffect>
                <DropShadowBitmapEffect
                    Direction="-90"
                    ShadowDepth="3"
                    Softness="0.1"
                    Color="#FF1D507A" />
            </Rectangle.BitmapEffect>
        </Rectangle>

        <Border
            Grid.Row="2"
            Grid.Column="1"
            Grid.ColumnSpan="3"
            MinHeight="360"
            Margin="30,70,30,30"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            BorderBrush="#77869b"
            BorderThickness="1"
            CornerRadius="10">
            <DataGrid
                x:Name="TimeSheetsDataGrid"
                Grid.Row="2"
                Grid.Column="1"
                Grid.ColumnSpan="3"
                MinHeight="360"
                Margin="0,5,0,5"
                Padding="0,0,0,0"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                AutoGenerateColumns="False"
                Background="#FFD6DFE1"
                BorderBrush="Transparent"
                HorizontalGridLinesBrush="#77869b"
                IsReadOnly="True"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding TimeSheets}"
                RowHeaderWidth="0"
                RowHeight="30"
                TextBlock.TextAlignment="Center"
                VerticalGridLinesBrush="#FFD6DFE1">

                <DataGrid.InputBindings>
                    <MouseBinding
                        Command="{Binding ShowTimeSheetRecordDetailCommand}"
                        CommandParameter="{Binding TimeSheets/}"
                        MouseAction="LeftDoubleClick" />
                </DataGrid.InputBindings>

                <DataGrid.Columns>
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=Id}"
                        Header="ID" />
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=From, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}"
                        Header="OD" />
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=To, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}"
                        Header="DO" />
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=Project.Name}"
                        Header="PROJEKT" />


                </DataGrid.Columns>

                <DataGrid.Resources>
                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FF3D70D1" />
                    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White" />
                    <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#FF3D70D1" />
                    <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White" />
                </DataGrid.Resources>

            </DataGrid>
        </Border>


    </Grid>
</UserControl>
