<Window x:Class="WpfApp4.TaskWindow"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:WpfApp4"
        mc:Ignorable="d"
        Title="Список задач" Height="450" Width="800">
    <Grid Background="#FFB55F5F">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="8*"/>
        </Grid.RowDefinitions>
        <DataGrid ColumnWidth="*" x:Name="tasks_table" ScrollViewer.CanContentScroll="True" IsReadOnly="True" ItemsSource="{Binding Tasks}" SelectedItem="{Binding Task}" AutoGenerateColumns="False"  Foreground="Black" BorderBrush="Black" Background="#FFB55F5F" Height="299" VerticalAlignment="Top" SelectionChanged="tasks_table_SelectionChanged" Margin="0,48,0,0" Grid.RowSpan="2">
            <DataGrid.Columns>

                <DataGridTextColumn Header="Номер задачи" Binding="{Binding Idtask}" ></DataGridTextColumn>
                <DataGridTextColumn Header="Название" Binding="{Binding Title}" ></DataGridTextColumn>
                <DataGridTextColumn Header="Описание" Binding="{Binding Description}" ></DataGridTextColumn>
                <DataGridTextColumn Header="Дата" Binding="{Binding DatePuplic,StringFormat= {}{0:yyyy}}" ></DataGridTextColumn>
                <DataGridTextColumn Header="Создатель  " Binding="{Binding IduserCreatedNavigation.Login}" ></DataGridTextColumn>
                <DataGridTextColumn Header="Испольнитель" Binding="{Binding  IduserAcceptNavigation.Login}"  ></DataGridTextColumn>
                <DataGridTextColumn Header="Статус" Binding="{Binding IdstatusTaskNavigation.Name}" ></DataGridTextColumn>
            </DataGrid.Columns>

        </DataGrid>
        <TextBox HorizontalAlignment="Left" Margin="42,336,0,0" Text="{Binding loginUser}" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Grid.Row="1"/>
        <Button Content="Найти" HorizontalAlignment="Left" Margin="181,334,0,0" Command="{Binding Find}" VerticalAlignment="Top" Width="79" Grid.Row="1"/>
        <Button Content="Изменить статус" HorizontalAlignment="Left"  Command="{Binding UpdateStatus}" CommandParameter="{Binding ElementName=tasks_table,Path=SelectedItem}" Margin="181,9,0,0" VerticalAlignment="Top"/>
        <Button Content="Принять задачу" HorizontalAlignment="Left" Command="{Binding GivTask}" CommandParameter="{Binding ElementName=tasks_table,Path=SelectedItem}" Margin="42,9,0,0" VerticalAlignment="Top"/>
        <Button Content="История  задач" HorizontalAlignment="Left" Command="{Binding HistoryComplateTask}" Margin="663,9,0,0" VerticalAlignment="Top"/>
        <Button Content="Доступные задачи" HorizontalAlignment="Left" Command="{Binding FreeTask}" Margin="513,9,0,0" VerticalAlignment="Top"/>
    </Grid>
</Window>
