<Window
    x:Class="Client.View.RequestDetailView"
    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:ei="http://schemas.microsoft.com/expression/2010/interactions"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
    xmlns:local="clr-namespace:Client.View"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vm="clr-namespace:Client.ViewModel"
    xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
    x:Name="RequestDetailWindow"
    Width="600"
    Height="530"
    Icon="/Client;component/Img/icon.png"
    ResizeMode="NoResize"
    VisualTextRenderingMode="ClearType"
    mc:Ignorable="d">

    <Grid Background="#FFD6DFE1">

        <Grid.RowDefinitions>
            <RowDefinition Height="50" />
            <RowDefinition Height="70" />
            <RowDefinition Height="70" />
            <RowDefinition Height="70" />
            <RowDefinition Height="70" />
            <RowDefinition Height="70" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Rectangle
            Grid.Row="0"
            Grid.Column="0"
            Grid.ColumnSpan="3"
            Height="50"
            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>
        <TextBlock
            Grid.Row="0"
            Grid.Column="0"
            Grid.ColumnSpan="3"
            Margin="50,10,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            FontSize="24"
            FontWeight="Bold"
            Foreground="White"
            Text="DETAIL POŽADAVKU" />

        <Label
            Grid.Row="1"
            Grid.Column="0"
            Margin="50,0,0,0"
            Content="Nadřízený zaměstnanec"
            Style="{StaticResource DetailLabel}" />
        <TextBox
            Grid.Row="1"
            Grid.Column="0"
            Width="220"
            Height="30"
            Margin="50,30,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Left"
            VerticalContentAlignment="Center"
            Background="White"
            BorderBrush="#77869b"
            BorderThickness="1"
            FontSize="16"
            Foreground="#FF383636"
            IsReadOnly="True">
            <TextBox.Text>
                <MultiBinding StringFormat="{}{0} {1}">
                    <Binding Path="Request.Supervisor.FirstName" />
                    <Binding Path="Request.Supervisor.LastName" />
                </MultiBinding>
            </TextBox.Text>
        </TextBox>

        <Button
            Grid.Row="1"
            Grid.Column="0"
            Width="15"
            Height="30"
            Margin="270,25,03,5"
            Padding="0,0,0,6"
            HorizontalAlignment="Left"
            VerticalAlignment="Center"
            HorizontalContentAlignment="Center"
            VerticalContentAlignment="Center"
            Background="#FF1D507A"
            BorderBrush="#FF24334D"
            BorderThickness="0"
            Command="{Binding SelectSupervisorCommand}"
            Content="..."
            FontSize="12"
            FontWeight="Bold"
            Foreground="White"
            Visibility="{Binding SelectEmployeeVisibility}" />

        <Label
            Grid.Row="2"
            Margin="50,0,0,0"
            Content="Popis"
            Style="{StaticResource DetailLabel}" />
        <TextBox
            Grid.Row="2"
            Grid.RowSpan="2"
            Grid.ColumnSpan="2"
            Width="495"
            Height="100"
            Margin="50,30,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Left"
            VerticalContentAlignment="Top"
            Background="White"
            BorderBrush="#77869b"
            BorderThickness="1"
            FontSize="16"
            Foreground="#FF383636"
            IsEnabled="{Binding IsReadOnlySupervisor}"
            Text="{Binding Path=Request.EmployeeDescription}"
            TextWrapping="Wrap" />

        <Label
            Grid.Row="4"
            Grid.ColumnSpan="2"
            Margin="50,0,0,0"
            Content="Vyjádření odpovědného zaměstnance"
            Style="{StaticResource DetailLabel}" />
        <TextBox
            Grid.Row="4"
            Grid.RowSpan="2"
            Grid.ColumnSpan="2"
            Width="495"
            Height="100"
            Margin="50,30,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Left"
            VerticalContentAlignment="Top"
            Background="White"
            BorderBrush="#77869b"
            BorderThickness="1"
            FontSize="16"
            Foreground="#FF383636"
            IsEnabled="{Binding IsReadOnlyEmployee}"
            Text="{Binding Path=Request.SupervisorComment}"
            TextWrapping="Wrap" />

        <Label
            Grid.Row="1"
            Grid.Column="1"
            Margin="14,0,0,0"
            Content="Stav"
            Style="{StaticResource DetailLabel}" />
        <ComboBox
            Grid.Row="1"
            Grid.Column="1"
            Width="235"
            Height="30"
            Margin="14,30,0,0"
            HorizontalAlignment="Left"
            VerticalAlignment="Top"
            HorizontalContentAlignment="Left"
            VerticalContentAlignment="Center"
            Background="Blue"
            FontSize="14"
            IsEnabled="{Binding IsReadOnlyEmployee}"
            ItemsSource="{Binding Path=RequestStatesLocalized}"
            SelectedItem="{Binding Path=SelectedRequestState, Mode=TwoWay}" />

        <Button
            Grid.Row="8"
            Grid.Column="1"
            Width="100"
            Height="30"
            Margin="0,25,48,25"
            HorizontalAlignment="Right"
            VerticalAlignment="Center"
            HorizontalContentAlignment="Center"
            Background="#FF1D507A"
            BorderBrush="#FF24334D"
            BorderThickness="0"
            Command="{Binding SaveRequestCommand}"
            CommandParameter="{Binding ElementName=RequestDetailWindow}"
            Content="ULOŽIT"
            FontSize="16"
            FontWeight="Bold"
            Foreground="White" />
        <Button
            Grid.Row="8"
            Grid.Column="1"
            Width="100"
            Height="30"
            Margin="0,25,183,25"
            HorizontalAlignment="Right"
            VerticalAlignment="Center"
            HorizontalContentAlignment="Center"
            Background="#FF1D507A"
            BorderBrush="#FF24334D"
            BorderThickness="0"
            Command="{Binding CancelCommand}"
            CommandParameter="{Binding ElementName=RequestDetailWindow}"
            Content="ZRUŠIT"
            FontSize="16"
            FontWeight="Bold"
            Foreground="White" />


    </Grid>
</Window>
