<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:PeerSDK.Samples"
    x:Class="PeerSDK.Samples.IrfWindow"
    Title="IRF"
    WindowStartupLocation="CenterScreen"
    FontFamily="Verdana"
    FontSize="16"
    ShowInTaskbar="false"
    Closed="Window_Closed"
    Width="600"
    >
    <Window.Resources>
        <local:IrfFrameTypeConverter x:Key="converter" />
    </Window.Resources>
    
    <ScrollViewer>
        <StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>Version:</Label>
                <Label Content="{Binding File.Version}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>Video Count:</Label>
                <Label Content="{Binding File.VideoCount}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>Audio Count:</Label>
                <Label Content="{Binding File.AudioCount}" />
            </StackPanel>
            <ListBox ItemsSource="{Binding File.ChannelNames}" HorizontalContentAlignment="Stretch">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <DockPanel>
                                <Label DockPanel.Dock="Left" Content="{Binding}" />
                            </DockPanel>
                            <Separator />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <Button Click="GetNextFrame_OnClick">Get Next Frame</Button>
            <Grid>
                <StackPanel Visibility="{Binding Type,Converter={StaticResource converter},ConverterParameter=Video}">
                    <Label>Video</Label>
                    <StackPanel Orientation="Horizontal">
                        <Label>Type:</Label>
                        <Label Content="{Binding Video.Type}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Channel:</Label>
                        <Label Content="{Binding Video.Channel}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Buffer length:</Label>
                        <Label Content="{Binding Video.Buffer.Length}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>PTS:</Label>
                        <Label Content="{Binding Video.PTS}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Time:</Label>
                        <Label Content="{Binding Video.Time}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Width:</Label>
                        <Label Content="{Binding Video.Width}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Height:</Label>
                        <Label Content="{Binding Video.Height}" />
                    </StackPanel>
                </StackPanel>
                <StackPanel Visibility="{Binding Type,Converter={StaticResource converter},ConverterParameter=Audio}">
                    <Label>Audio</Label>
                    <StackPanel Orientation="Horizontal">
                        <Label>Type:</Label>
                        <Label Content="{Binding Audio.Type}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Channel:</Label>
                        <Label Content="{Binding Audio.Channel}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Buffer length:</Label>
                        <Label Content="{Binding Audio.Buffer.Length}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>PTS:</Label>
                        <Label Content="{Binding Audio.PTS}" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Label>Time:</Label>
                        <Label Content="{Binding Audio.Time}" />
                    </StackPanel>
                </StackPanel>
            </Grid>
        </StackPanel>
    </ScrollViewer>
</Window>