<ContentDialog
    x:Class="PCUT.Pages.PortSettingDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:PCUT.Pages"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    PrimaryButtonText="Close"
    PrimaryButtonStyle="{StaticResource CloseDialogButton}"
    Title="Port Setting">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0.2*"/>
            <ColumnDefinition Width="0.8*"/>
        </Grid.ColumnDefinitions>
        <TextBlock Grid.Row="0" Grid.Column="0"
                   Text="Baud Rate:"
                   FontFamily="/Fonts/#Rubik Medium"
                   VerticalAlignment="Center"
                   Margin="0,0,5,0" />
        <TextBox Grid.Row="0" Grid.Column="1"
                 Text="{x:Bind ViewModel.BaudRate, Mode=TwoWay}"
                 HorizontalAlignment="Stretch"
                 BeforeTextChanging="TextBox_BeforeTextChanging" />
        <TextBlock Grid.Row="1" Grid.Column="0"
                   Text="Databits:"
                   FontFamily="/Fonts/#Rubik Medium"
                   VerticalAlignment="Center"
                   Margin="0,0,5,0"/>
        <TextBox Grid.Row="1" Grid.Column="1"
                 Text="{x:Bind ViewModel.Databits, Mode=TwoWay}"
                 HorizontalAlignment="Stretch"
                 BeforeTextChanging="TextBox_BeforeTextChanging" />
        <TextBlock Grid.Row="2" Grid.Column="0"
                   Text="Parity:"
                   FontFamily="/Fonts/#Rubik Medium"
                   VerticalAlignment="Center"
                   Margin="0,0,5,0" />
        <ComboBox Grid.Row="2" Grid.Column="1"
                  ItemsSource="{x:Bind ViewModel.ParityList, Mode=OneWay}"
                  SelectedIndex="{x:Bind ViewModel.SelectedParity, Mode=TwoWay}"
                  HorizontalAlignment="Stretch" />
        <TextBlock Grid.Row="3" Grid.Column="0"
                   Text="Stopbits:"
                   FontFamily="/Fonts/#Rubik Medium"
                   VerticalAlignment="Center"
                   Margin="0,0,5,0" />
        <ComboBox Grid.Row="3" Grid.Column="1"
                  ItemsSource="{x:Bind ViewModel.StopbitsList, Mode=OneWay}"
                  SelectedIndex="{x:Bind ViewModel.SelectedStopbits, Mode=TwoWay}"
                  HorizontalAlignment="Stretch" />
        <TextBlock Grid.Row="4" Grid.Column="0"
                   Text="Cut Speed:"
                   FontFamily="/Fonts/#Rubik Medium"
                   VerticalAlignment="Center"
                   Margin="0,0,5,0"/>
        <TextBox Grid.Row="4" Grid.Column="1"
                 Text="{x:Bind ViewModel.Speed, Mode=TwoWay}"
                 HorizontalAlignment="Stretch"
                 BeforeTextChanging="TextBox_BeforeTextChanging" />
        <TextBlock Grid.Row="5" Grid.Column="0"
                   Text="Pen:"
                   FontFamily="/Fonts/#Rubik Medium"
                   VerticalAlignment="Center"
                   Margin="0,0,5,0" />
        <ComboBox Grid.Row="5" Grid.Column="1"
                  ItemsSource="{x:Bind ViewModel.PenList, Mode=OneWay}"
                  SelectedIndex="{x:Bind ViewModel.SelectedPen, Mode=TwoWay}"
                  HorizontalAlignment="Stretch" />
    </Grid>

</ContentDialog>
