<UserControl
    x:Class="Client.View.InfoPanelView"
    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="800"
    d:DesignWidth="1400"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="60" />
            <RowDefinition Height="200" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="50" MaxWidth="200" />
            <ColumnDefinition Width="350" MinWidth="250" />
            <ColumnDefinition Width="*" MinWidth="1" />
            <ColumnDefinition Width="165" MinWidth="165" />
            <ColumnDefinition Width="20" MinWidth="20" />
            <ColumnDefinition Width="165" MinWidth="165" />
            <ColumnDefinition Width="*" MinWidth="1" />
            <ColumnDefinition Width="350" MinWidth="250" />
            <ColumnDefinition MinWidth="50" MaxWidth="200" />
        </Grid.ColumnDefinitions>
        <Label
            Grid.Row="0"
            Grid.Column="1"
            Grid.ColumnSpan="4"
            HorizontalAlignment="Left"
            VerticalAlignment="Bottom"
            Content="Vítejte v informačním systému DVSoft"
            FontSize="36"
            FontWeight="Bold"
            Foreground="#FF065393" />

        <Rectangle
            Grid.Row="1"
            Grid.Column="1"
            MinWidth="290"
            Margin="10,30,10,30"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Fill="#FFD6DFE1"
            RadiusX="25"
            RadiusY="25">
            <Rectangle.BitmapEffect>
                <DropShadowBitmapEffect
                    Direction="-90"
                    ShadowDepth="3"
                    Softness="0.1"
                    Color="#FF10BCE2" />
            </Rectangle.BitmapEffect>
        </Rectangle>
        <Label
            Grid.Row="1"
            Grid.Column="1"
            Margin="30,50,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Content="ODPRACOVANÉ HODINY"
            FontSize="20"
            FontWeight="Bold"
            Foreground="Black" />
        <Viewbox
            Grid.Row="1"
            Grid.Column="1"
            Width="75"
            Height="75"
            Margin="0,10,15,0"
            HorizontalAlignment="Right"
            VerticalAlignment="Center">
            <Grid>
                <Ellipse
                    Grid.Row="1"
                    Grid.Column="3"
                    Width="75"
                    Height="75"
                    Margin="0,0,0,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Fill="#FF10BCE2" />
                <Label
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{Binding WorkedHours}"
                    FontSize="28"
                    FontWeight="Bold"
                    Foreground="White" />
            </Grid>
        </Viewbox>
        <TextBlock
            Grid.Row="1"
            Grid.Column="1"
            MaxWidth="225"
            Margin="35,85,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            FontSize="18"
            Text="Počet odpracovaných hodin v tomto měsíci."
            TextAlignment="Left"
            TextWrapping="Wrap" />

        <Rectangle
            Grid.Row="1"
            Grid.Column="3"
            Grid.ColumnSpan="3"
            MinWidth="290"
            Margin="11,30,10,30"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Fill="#FFD6DFE1"
            RadiusX="25"
            RadiusY="25">
            <Rectangle.BitmapEffect>
                <DropShadowBitmapEffect
                    Direction="-90"
                    ShadowDepth="3"
                    Softness="0.1"
                    Color="#FF10BCE2" />
            </Rectangle.BitmapEffect>
        </Rectangle>
        <Label
            Grid.Row="1"
            Grid.Column="3"
            Grid.ColumnSpan="3"
            Margin="30,50,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Content="NEVYŘÍZENÉ ŽÁDOSTI"
            FontSize="20"
            FontWeight="Bold"
            Foreground="Black" />
        <Viewbox
            Grid.Row="1"
            Grid.Column="3"
            Grid.ColumnSpan="3"
            Width="75"
            Height="75"
            Margin="0,10,15,0"
            HorizontalAlignment="Right"
            VerticalAlignment="Center">
            <Grid>
                <Ellipse
                    Grid.Row="1"
                    Grid.Column="3"
                    Grid.ColumnSpan="1"
                    Width="75"
                    Height="75"
                    Margin="0,0,0,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Fill="#FF10BCE2" />
                <Label
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{Binding RequestsCount}"
                    FontSize="28"
                    FontWeight="Bold"
                    Foreground="White" />
            </Grid>
        </Viewbox>
        <TextBlock
            Grid.Row="1"
            Grid.Column="3"
            Grid.ColumnSpan="3"
            MaxWidth="225"
            Margin="35,85,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            FontSize="18"
            Text="{Binding UnprocessedRequestsText}"
            TextAlignment="Left"
            TextWrapping="Wrap" />

        <Rectangle
            Grid.Row="1"
            Grid.Column="7"
            MinWidth="290"
            Margin="11,30,9,30"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Stretch"
            Fill="#FFD6DFE1"
            RadiusX="25"
            RadiusY="25">
            <Rectangle.BitmapEffect>
                <DropShadowBitmapEffect
                    Direction="-90"
                    ShadowDepth="3"
                    Softness="0.1"
                    Color="#FF10BCE2" />
            </Rectangle.BitmapEffect>
        </Rectangle>
        <Label
            Grid.Row="1"
            Grid.Column="7"
            Margin="30,50,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            Content="PERSONÁLNÍ UDÁLOSTI"
            FontSize="20"
            FontWeight="Bold"
            Foreground="Black" />
        <Viewbox
            Grid.Row="1"
            Grid.Column="7"
            Width="75"
            Height="75"
            Margin="0,10,15,0"
            HorizontalAlignment="Right"
            VerticalAlignment="Center">
            <Grid>
                <Ellipse
                    Grid.Row="1"
                    Grid.Column="6"
                    Width="75"
                    Height="75"
                    Margin="0,0,0,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Fill="#FF10BCE2" />
                <Label
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="{Binding PersonalEventsCount}"
                    FontSize="28"
                    FontWeight="Bold"
                    Foreground="White" />
            </Grid>
        </Viewbox>
        <TextBlock
            Grid.Row="1"
            Grid.Column="7"
            MaxWidth="225"
            Margin="35,85,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            FontSize="18"
            Text="{Binding PersonalRequestsText}"
            TextAlignment="Left"
            TextWrapping="Wrap" />

        <Rectangle
            Grid.Row="2"
            Grid.Column="1"
            Grid.ColumnSpan="3"
            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="NEVYŘÍZENÉ ŽÁDOSTI"
            FontSize="24"
            FontWeight="Bold"
            Foreground="White" />

        <Rectangle
            Grid.Row="2"
            Grid.Column="1"
            Grid.ColumnSpan="3"
            MinHeight="300"
            MaxHeight="300"
            Margin="0,50,0,95"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top"
            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="260"
            MaxHeight="260"
            Margin="30,60,30,100"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top"
            BorderBrush="#77869b"
            BorderThickness="1"
            CornerRadius="5">
            <DataGrid
                x:Name="RequestsDataGrid"
                Grid.Row="2"
                Grid.Column="1"
                Grid.ColumnSpan="3"
                MinHeight="250"
                MaxHeight="250"
                Margin="0,0,0,105"
                Padding="0,0,0,0"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                AutoGenerateColumns="False"
                Background="#FFD6DFE1"
                BorderBrush="Transparent"
                HorizontalGridLinesBrush="#77869b"
                IsReadOnly="True"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding Requests}"
                RowHeaderWidth="0"
                RowHeight="30"
                TextBlock.TextAlignment="Center"
                VerticalGridLinesBrush="#FFD6DFE1">

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

                <DataGrid.Columns>
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=TimeStamp, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}"
                        Header="ČAS ODESLÁNÍ" />
                    <DataGridTextColumn Width="*" Header="ODESÍLATEL">
                        <DataGridTextColumn.Binding>
                            <MultiBinding StringFormat="{}{0} {1}">
                                <Binding Path="Employee.FirstName" />
                                <Binding Path="Employee.LastName" />
                            </MultiBinding>
                        </DataGridTextColumn.Binding>
                    </DataGridTextColumn>
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=RequestState, Converter={StaticResource RequestStateConverter}}"
                        Header="STAV" />

                </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>

        <Rectangle
            Grid.Row="2"
            Grid.Column="5"
            Grid.ColumnSpan="3"
            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="5"
            Grid.ColumnSpan="3"
            Margin="30,5,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Center"
            VerticalContentAlignment="Center"
            Content="UDÁLOSTI V TOMTO TÝDNU"
            FontSize="24"
            FontWeight="Bold"
            Foreground="White" />

        <Rectangle
            Grid.Row="2"
            Grid.Column="5"
            Grid.ColumnSpan="3"
            MinHeight="300"
            MaxHeight="300"
            Margin="0,50,0,95"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top"
            Fill="#FFD6DFE1">
            <Rectangle.BitmapEffect>
                <DropShadowBitmapEffect
                    Direction="-90"
                    ShadowDepth="3"
                    Softness="0.1"
                    Color="#FF1D507A" />
            </Rectangle.BitmapEffect>
        </Rectangle>

        <Border
            Grid.Row="2"
            Grid.Column="5"
            Grid.ColumnSpan="3"
            MinHeight="260"
            MaxHeight="260"
            Margin="30,60,30,100"
            HorizontalAlignment="Stretch"
            VerticalAlignment="Top"
            BorderBrush="#77869b"
            BorderThickness="1"
            CornerRadius="5">
            <DataGrid
                x:Name="PersonalEventsDataGrid"
                Grid.Row="2"
                Grid.Column="5"
                Grid.ColumnSpan="3"
                MinHeight="250"
                MaxHeight="250"
                Margin="0,0,0,105"
                Padding="0,0,0,0"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                AutoGenerateColumns="False"
                Background="#FFD6DFE1"
                BorderBrush="Transparent"
                HorizontalGridLinesBrush="#77869b"
                IsReadOnly="True"
                IsSynchronizedWithCurrentItem="True"
                ItemsSource="{Binding PersonalEvents}"
                RowHeaderWidth="0"
                RowHeight="30"
                TextBlock.TextAlignment="Center"
                VerticalGridLinesBrush="#FFD6DFE1">

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

                <DataGrid.Columns>
                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=DateTime, StringFormat=\{0:dd/MM/yy HH:mm:ss\}}"
                        Header="DATUM UDÁLOSTI" />

                    <DataGridTextColumn
                        Width="*"
                        Binding="{Binding Path=PersonalEventType.Name}"
                        Header="TYP UDÁLOSTI" />

                </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>
