<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="Window3" Height="450" Width="800">
    <Grid Background="Black">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="8*"/>
        </Grid.RowDefinitions>
        <DataGrid ColumnWidth="*" x:Name="tasks_table" ScrollViewer.CanContentScroll="True" IsReadOnly="True" Grid.Row="1" ItemsSource="{Binding Tasks}" SelectedItem="{Binding Task}" AutoGenerateColumns="False"  Foreground="Black" BorderBrush="Black" Background="Black" Height="434" VerticalAlignment="Top">
            <DataGrid.Columns>

                <DataGridTextColumn Header="ID" 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="25,11,0,0" Text="{Binding loginUser}" TextWrapping="Wrap" VerticalAlignment="Top" Width="120"/>
        <Button Content="Найти" HorizontalAlignment="Left" Margin="150,9,0,0" Command="{Binding Find}" VerticalAlignment="Top" Width="79"/>
        <Button Content="Изменить статус" HorizontalAlignment="Left"  Command="{Binding UpdateStatus}" CommandParameter="{Binding ElementName=tasks_table,Path=SelectedItem}" Margin="245,10,0,0" VerticalAlignment="Top"/>
        <Button Content="Принять задачу" HorizontalAlignment="Left" Command="{Binding GivTask}" CommandParameter="{Binding ElementName=tasks_table,Path=SelectedItem}" Margin="366,11,0,0" VerticalAlignment="Top"/>
        <Button Content="История выполненных задач" HorizontalAlignment="Left" Command="{Binding HistoryComplateTask}" Margin="485,9,0,0" VerticalAlignment="Top"/>
        <Button Content="Доступные задачи" HorizontalAlignment="Left" Command="{Binding FreeTask}" Margin="674,11,0,0" VerticalAlignment="Top"/>
    </Grid>
</Window>
