<Window x:Class="Rkis29.View.Tasks"
        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:Rkis29.View" xmlns:b="http://schemas.microsoft.com/xaml/behaviors" xmlns:viewmodel="clr-namespace:Rkis29.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:VWTask}"
        mc:Ignorable="d"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        Title="Tasks" Name="TaskWND" Height="450" Width="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <TextBlock  Text="Список задач" Grid.Column="2" 
                   Grid.ColumnSpan="3" FontSize="28" 
                   HorizontalAlignment="Left" Margin="94,1,0,61" 
                   Grid.RowSpan="2" VerticalAlignment="Center" FontWeight="Bold" FontStyle="Normal" >
        </TextBlock>
        <DataGrid   Grid.ColumnSpan="7" Name="PoiskGrid" AutoGenerateColumns="False" IsReadOnly="True" Grid.RowSpan="5" Grid.Row="1" Margin="114,62,114,24">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Название" Binding="{Binding NameT}" Width="*"></DataGridTextColumn>
                <DataGridTextColumn Header="Описание" Binding="{Binding Description}" Width="*"></DataGridTextColumn>
                <DataGridTextColumn Header="Дата" Binding="{Binding Date}" Width="*"></DataGridTextColumn>
                <DataGridTextColumn Header="Автор" Binding="{Binding Person1.SurnameP}" Width="*"></DataGridTextColumn>
                <DataGridTextColumn Header="Статус" Binding="{Binding StatusTask.Name}" Width="*"></DataGridTextColumn>
            </DataGrid.Columns>
        </DataGrid>
        <ComboBox   Name="TbLogins" Grid.Column="2" Grid.Row="1" SelectedItem="{Binding Login}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="229" ItemsSource="{Binding DataComboGo}" DisplayMemberPath="Logins"
                 Height="39" Grid.ColumnSpan="3" Margin="113,18,0,0"/>
        <TextBlock  Text="Найти задачу(по автору)" HorizontalAlignment="Left" 
                   FontSize="19" Grid.Row="1" VerticalAlignment="Top" Margin="114,23,0,0" Grid.ColumnSpan="3"/>
        <Button  Command="{Binding SearchBtn}" CommandParameter="{Binding ElementName=TaskWND}" Background="#FFB5B8B1" Grid.Column="5" FontSize="20"
                HorizontalAlignment="Center" VerticalAlignment="Top" Width="95" Margin="0,18,0,0" Height="34" Grid.Row="1" Content="Найти"/>
        <Button  Command="{Binding ChandgeBtn}" CommandParameter="{Binding ElementName=PoiskGrid}" Background="#FFB5B8B1" Grid.Column="5" FontSize="20"
                HorizontalAlignment="Center" VerticalAlignment="Top" Width="95" Margin="0,43,0,0" Height="34" Grid.Row="5" Content="Взять" Grid.RowSpan="2"/>
        <Button  Command="{Binding BackBtn}" CommandParameter="{Binding ElementName=TaskWND}" Background="#FFB5B8B1" FontSize="20"
                HorizontalAlignment="Center" VerticalAlignment="Center" Width="95" Height="34" Content="Назад"/>
        <b:Interaction.Triggers>
            <b:EventTrigger EventName="Loaded">
                <b:InvokeCommandAction Command="{Binding Data}" CommandParameter="{Binding ElementName=PoiskGrid}">
                </b:InvokeCommandAction>
            </b:EventTrigger>
        </b:Interaction.Triggers>
    </Grid>
</Window>
