<Window x:Class="ScreenToGif.Windows.NewWebcam"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="NewWebcam" Height="450" Width="800"
        Loaded="Window_Loaded">

    <Grid Background="{StaticResource Checker.DrawingBrush}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Image Grid.Row="1" x:Name="MainImage" VerticalAlignment="Center" HorizontalAlignment="Center"/>
        
        <Grid Grid.Row="2" x:Name="ControlGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <ComboBox Grid.Column="1" x:Name="SourceComboBox" MinWidth="120" Margin="3" TabIndex="2" ItemsSource="{Binding VideoSources, UpdateSourceTrigger=PropertyChanged}" 
                      SelectedItem="{Binding SelectedVideoSource, UpdateSourceTrigger=PropertyChanged}" SelectionChanged="SourceComboBox_SelectionChanged">

                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="30"/>
                                <ColumnDefinition Width="1"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Border Grid.Row="0" Grid.Column="0" x:Name="InternalViewBox"  Margin="1,1,4,1" VerticalAlignment="Center" HorizontalAlignment="Center" Height="18"
                                    Background="{StaticResource Vector.Camera}" Visibility="Visible" Effect="{x:Null}" Opacity="{DynamicResource Element.Opacity}"/>
                            
                            <Separator Grid.Column="1" Width="1" Margin="0"/>
                            
                            <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding Name}" Margin="10,0,2,0" Foreground="{DynamicResource Element.Foreground.Medium}" VerticalAlignment="Center"/>
                            
                            <!--<TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Description}" Margin="10,0,2,0" Foreground="{DynamicResource Element.Foreground.Gray112}" 
                                       TextTrimming="CharacterEllipsis" FontSize="11" VerticalAlignment="Center"/>-->
                        </Grid>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>

            <ComboBox Grid.Column="2" x:Name="MediaComboBox" MinWidth="120" Margin="3" TabIndex="2" ItemsSource="{Binding SelectedVideoSource.MediaSources, UpdateSourceTrigger=PropertyChanged}" 
                      SelectedItem="{Binding SelectedMediaSource, UpdateSourceTrigger=PropertyChanged}" SelectionChanged="MediaComboBox_SelectionChanged">

                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="30"/>
                                <ColumnDefinition Width="1"/>
                                <ColumnDefinition/>
                            </Grid.ColumnDefinitions>

                            <Border Grid.Row="0" Grid.Column="0" x:Name="InternalViewBox"  Margin="1,1,4,1" VerticalAlignment="Center" HorizontalAlignment="Center" Height="18"
                                    Background="{StaticResource Vector.Video}" Visibility="Visible" Effect="{x:Null}" Opacity="{DynamicResource Element.Opacity}"/>

                            <Separator Grid.Column="1" Width="1" Margin="0"/>

                            <TextBlock Grid.Row="0" Grid.Column="2" Margin="10,0,2,0" Foreground="{DynamicResource Element.Foreground.Medium}" VerticalAlignment="Center">
                                <Run Text="{Binding Width, StringFormat={}{0}}"/>
                                <Run Text="x"/>
                                <Run Text="{Binding Height, StringFormat={}{0}}"/>
                            </TextBlock>

                            <!--<TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding Description}" Margin="10,0,2,0" Foreground="{DynamicResource Element.Foreground.Gray112}" 
                                       TextTrimming="CharacterEllipsis" FontSize="11" VerticalAlignment="Center"/>-->
                        </Grid>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
        </Grid>
    </Grid>
</Window>