<UserControl x:Class="TeamViewerApi.Views.CreateContactView" 
             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:viewModels="clr-namespace:TeamViewerApi.ViewModels" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="500">
    
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Row="0" Grid.Column="0" Text="Email" />
        <TextBox Grid.Row="0" Grid.Column="1"  Width="150px" Text="{Binding Contact.Email, Mode=TwoWay}" />
        <TextBlock Grid.Row="1" Grid.Column="0" Text="Select group" />
        <ComboBox Grid.Row="1" Grid.Column="1" 
                  HorizontalAlignment="Left" 
                  Width="150px" 
                  SelectedValuePath="Name"
                  ItemsSource="{Binding Groups.Items, Mode=OneWay}" 
                  SelectedValue="{Binding Contact.GroupName, Mode=TwoWay}">
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <TextBlock Style="{x:Null}" Text="{Binding Name, Mode=OneWay}" />
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
        <TextBlock Grid.Row="1" Grid.Column="2" Text="or enter" />
        <TextBox Grid.Row="1" Grid.Column="3" Width="150px" Text="{Binding CustomGroupName, Mode=TwoWay}" />
        <TextBlock Grid.Row="3" Grid.Column="0" Text="Description" />
        <TextBox Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Text="{Binding Contact.Description, Mode=TwoWay}" />
        <TextBlock Grid.Row="4" Grid.Column="0" Text="Invite" />
        <CheckBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Content="Send invite Email?" IsChecked="{Binding Contact.SendInviteEmail}" />
        
        <DockPanel Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" LastChildFill="False">
            <Button DockPanel.Dock="Left" 
                    Content="Confirm" 
                    Command="{Binding ConfirmCommand, Mode=OneWay}" />
            <Button DockPanel.Dock="Right" 
                    Content="Cancel" 
                    Command="{Binding CancelCommand, Mode=OneWay}" />
        </DockPanel>
    </Grid>
</UserControl>
