<UserControl x:Class="TwoCamWPF.Settings.SettingsPage.FileSettingsPage"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:t="http://schemas.microsoft.com/wpf/2008/toolkit"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <t:DataGrid ItemsSource="{Binding camerasModel}"   AutoGenerateColumns="False" Name="dataGrid1">
        <t:DataGrid.Columns>
            <t:DataGridTemplateColumn Header="Камера"  IsReadOnly="True">
                <t:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding Name}"  IsEnabled="{Binding IsUsing}"  />
                    </DataTemplate>
                </t:DataGridTemplateColumn.CellTemplate>
            </t:DataGridTemplateColumn>
            <t:DataGridTemplateColumn Header="Название потока"  IsReadOnly="True">
                <t:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <TextBox Text="{Binding StreamName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  IsEnabled="{Binding IsUsing}"  VerticalAlignment="Top"  />
                    </DataTemplate>
                </t:DataGridTemplateColumn.CellTemplate>
            </t:DataGridTemplateColumn>


            <t:DataGridTemplateColumn Header="Превью"  IsReadOnly="True">
                <t:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <Image Source="{Binding Image}"
                                               
                                    Width="100"
                                    Stretch="Uniform"
                                    Height="100" >
                        </Image>
                    </DataTemplate>
                </t:DataGridTemplateColumn.CellTemplate>
            </t:DataGridTemplateColumn>

            <t:DataGridTemplateColumn Header="Кодек" Width="200">
                <t:DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <ComboBox Height="23" VerticalAlignment="Top"
                                    ItemsSource="{Binding Codecs}"     
                                    IsEnabled="{Binding IsUsing}" 
                                    SelectedItem="{Binding Codec, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                        Margin="5">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding}" />
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </DataTemplate>
                </t:DataGridTemplateColumn.CellTemplate>
            </t:DataGridTemplateColumn>
        </t:DataGrid.Columns>
        <t:DataGrid.RowStyle>
            <Style TargetType="t:DataGridRow">
                <Style.Triggers>
                    <DataTrigger  Binding="{Binding IsUsing}"  Value="True">
                        <Setter Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsUsing}" Value="False" >
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
              
            </Style>
        </t:DataGrid.RowStyle>
    </t:DataGrid>

</UserControl>
