<Window x:Class="SampleConferenceApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:AvayaMedia="clr-namespace:Avaya.ClientServices.Media;assembly=scpmediadll"
        xmlns:ui="clr-namespace:SampleConferenceApp.UI"
        Title="Client SDK Conferencing Sample App" MinHeight="500" Height="700" MinWidth="390" Width="900" Closing="Window_Closing" Loaded="Window_Loaded">
    <Window.Resources>        
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
        <ui:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
    </Window.Resources>
    <Grid>

        <Label x:Name="OTTSampleAppLabel" Content="Sample Conference App" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" 
               Visibility="{Binding Path=IsInitialScreenVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
        
        <Grid Name="HttpCallServiceGrid" Visibility="{Binding Path=IsHttpCallServiceGridVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label x:Name="httpCallServiceLabel" Content="Call Service" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="20" FontWeight="SemiBold"/>
            <Button x:Name="AboutBtn" Content="About" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="14" Margin="0,0,10,0" Padding="20,10" Click="aboutBtn_Click"/>
            <Label x:Name="ConferenceUrlLabel" Content="Conference to Join" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <TextBox x:Name="ConferenceUrlBox" HorizontalAlignment="Stretch" Grid.Row="1" Margin="150,10,10,10" TextWrapping="Wrap" VerticalAlignment="Stretch" FontSize="14" MinHeight="100"/>
            <Label x:Name="AsGuestLabel" Content="Login as Guest" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <CheckBox x:Name="AsGuestCheckBox" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="150,10,10,10">
                <CheckBox.LayoutTransform>
                    <ScaleTransform ScaleX="1.7" ScaleY="1.7" />
                </CheckBox.LayoutTransform>
            </CheckBox>
            <Label x:Name="YourNameLabel" IsEnabled="{Binding ElementName=AsGuestCheckBox, Path=IsChecked}" Content="Your Name" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <TextBox x:Name="YourNameBox" IsEnabled="{Binding ElementName=AsGuestCheckBox, Path=IsChecked}" HorizontalAlignment="Stretch" Grid.Row="3" TextWrapping="Wrap" VerticalAlignment="Stretch" FontSize="14" Margin="150,10,10,10"/>
            <Label x:Name="UsernameLabel" IsEnabled="{Binding ElementName=AsGuestCheckBox, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"
                   Content="Username" Grid.Row="4" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <TextBox x:Name="UsernameBox" IsEnabled="{Binding ElementName=AsGuestCheckBox, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"
                     HorizontalAlignment="Stretch" Grid.Row="4" TextWrapping="Wrap" VerticalAlignment="Stretch" FontSize="14" Margin="150,10,10,10"/>
            <Label x:Name="PasswordLabel" IsEnabled="{Binding ElementName=AsGuestCheckBox, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"
                   Content="Password" Grid.Row="5" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <TextBox x:Name="PasswordBox" IsEnabled="{Binding ElementName=AsGuestCheckBox, Path=IsChecked, Converter={StaticResource InverseBooleanConverter}}"
                     HorizontalAlignment="Stretch" Grid.Row="5" TextWrapping="Wrap" VerticalAlignment="Stretch" FontSize="14" Margin="150,10,10,10"/>
            <Grid Grid.Row="6">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Button x:Name="httpAudioCallBtn" Content="Make Audio Call" Click="httpAudioCallBtn_Click" FontSize="14" Margin="10" Height="80"/>
                <Button x:Name="httpVideoCallBtn" Content="Make Video Call" Grid.Column="1" Click="httpVideoCallBtn_Click" FontSize="14" Margin="10" Height="80"/>
            </Grid>
            <Label x:Name="HttpCallCreationResult" Grid.Row="7" Visibility="{Binding Path=IsHttpCallCreationResultVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
                   Content="" HorizontalAlignment="Stretch" VerticalAlignment="Center"
                   FontSize="14" Foreground="Red" FontWeight="SemiBold"/>
        </Grid>

        <Grid Name="ActiveCallGrid" Visibility="{Binding Path=IsActiveCallGridVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="3*"/>
                <RowDefinition Height="3*"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label x:Name="activeCallLabel" Content="Active Call" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="20" FontWeight="SemiBold"/>
            <Label x:Name="callDurationLabel" Content="Call Duration:" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <Label x:Name="callDuration" Content="{Binding Path=CallDurationContent}" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Margin="100,10,10,10"/>
            <Label x:Name="callStateLabel" Content="Call State:" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14"/>
            <Label x:Name="callState" Content="{Binding Path=CallStateContent}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Margin="100,10,10,10"/>
            <Label x:Name="muteLabel" Content="Mute" HorizontalAlignment="Left" Grid.Row="3" VerticalAlignment="Center" FontSize="14"/>
            <Button x:Name="muteBtn" Content="{Binding Path=MuteBtnContent}" Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Center" Click="muteBtn_Click" FontSize="14" Padding="10,5,10,5" Margin="100,10,10,10"/>
            <Button x:Name="conferenceControlsBtn" Visibility="{Binding Path=IsConferenceControlsBtnVisible, Converter={StaticResource BooleanToVisibilityConverter}}" Content="Conference Controls"  
                    Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Center" Click="conferenceControlsBtn_Click" FontSize="14" Padding="10,5,10,5" Margin="0,10,50,10"/>
            <Grid Name="VideoGrid" Visibility="{Binding Path=IsVideoGridVisible, Converter={StaticResource BooleanToVisibilityConverter}}" Grid.Row="4">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Image x:Name="RemoteVideo" Stretch="Uniform">
                    <Image.Source>
                        <AvayaMedia:VideoRenderer2/>
                    </Image.Source>
                </Image>
                <Label x:Name="remoteVideolabel" Content="Remote Video" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/>
                <Image Name="LocalVideo"  Stretch="Uniform" Grid.Column="1">
                    <Image.Source>
                        <AvayaMedia:VideoRenderer2/>
                    </Image.Source>
                </Image>
                <Label x:Name="localVIdeolabel" Content="Local Video" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="14"/>
            </Grid>
            <Grid Grid.Row="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Label Content="Participants:" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Margin="10"/>
                <ListView x:Name="participantList" Grid.Row="5" DisplayMemberPath="DisplayName"/>
            </Grid>
            <Button x:Name="endCallBtn" Content="End Call" Grid.Row="6" Click="endCallBtn_Click" FontSize="20" Margin="30,10,30,10" Height="50"/>
        </Grid>

        <Grid Name="AboutScreenGrid" Visibility="{Binding Path=IsAboutScreenGridVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label x:Name="aboutScreenLabel" Content="About" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="20" FontWeight="SemiBold"/>
            <Button x:Name="aboutBackBtn" Content="Back" HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Margin="5,0,0,0" Padding="20,10" Click="aboutBackBtn_Click"/>
            <Label x:Name="appVersionLabel" Content="Sample App Version: " HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Grid.Row="1"/>
            <Label x:Name="appBuildDateLabel" Content="Build date: " HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Grid.Row="2"/>
            <Label x:Name="avayaClientServicesLabel" Content="Client SDK Version: " HorizontalAlignment="Left" VerticalAlignment="Center" FontSize="14" Grid.Row="3"/>            
        </Grid>
    </Grid>
</Window>