<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="PeerSDK.Samples.PeerWindow"
    WindowStartupLocation="CenterScreen"
    FontFamily="Verdana"
    FontSize="16"
    ShowInTaskbar="false"
    Closed="Window_Closed"
    Width="600"
    >
    <ScrollViewer>
        <StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>Type:</Label>
                <Label Content="{Binding Peer.Type}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>VideoFormatDetectMethod:</Label>
                <StackPanel>
                    <Label Content="{Binding Peer.VideoFormatDetectMethod}" />
                    <ListBox ItemsSource="{Binding AvailableVideoFormatDetection}" HorizontalContentAlignment="Stretch" >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Button Content="{Binding Item1}" IsEnabled="{Binding Item2}" Click="VideoFormatDetection_Click" Tag="{Binding Item1}" />
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </StackPanel>
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>OutputVideoFormat:</Label>
                <Label Content="{Binding Peer.OutputVideoFormat}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">
                <Label>Channels:</Label>
                <Label Content="{Binding Peer.Channels.Length}" />
            </StackPanel>
            <ListBox ItemsSource="{Binding Peer.Channels}" HorizontalContentAlignment="Stretch">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <DockPanel>
                                <Button DockPanel.Dock="Right" IsEnabled="{Binding Audio.IsPresent}">Audio</Button>
                                <Button DockPanel.Dock="Right" IsEnabled="{Binding Video.PTZ.Enabled}">PTZ</Button>
                                <Label DockPanel.Dock="Left" Content="{Binding Name}" />
                            </DockPanel>
                            <Separator />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
            <StackPanel Orientation="Horizontal">
                <Label>Relays:</Label>
                <Label Content="{Binding Peer.Relays.Length}" />
            </StackPanel>
            <ListBox ItemsSource="{Binding Peer.Relays}" HorizontalContentAlignment="Stretch">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <Label Content="Relay" />
                            </StackPanel>
                            <Separator />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <Separator />
            
            <Button Click="CreateLiveStream_OnClick">Create Live Stream</Button>
            <!--
            <Button Click="CreatePlaybackStream_OnClick">Create Playback Stream</Button>
            <Button Click="CreateBackupStream_OnClick">Create Backup Stream</Button>
            -->

            <Separator />

            <Button Click="CreateRecordList_OnClick">CreateRecordList</Button>
            <Button Click="GetLogList_OnClick">GetLogList</Button>
            <Button Click="GetHDDList_OnClick">GetHDDList</Button>
            <ListBox ItemsSource="{Binding HDDs}">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <Label Content="HDD" />
                                <Label Content="{Binding Available}" />
                                <Label Content="/" />
                                <Label Content="{Binding Capacity}" />
                            </StackPanel>
                            <Separator />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>

            <Separator />
            <Button Click="Ack_OnClick">Ack</Button>
        </StackPanel>
    </ScrollViewer>
</Window>