<Window x:Class="IOSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:IOSample"
        mc:Ignorable="d" Background="#FFFFE4E4"
        Title="RT-edge Tag Input/Output Sample" Height="260" Width="450" Closing="Window_Closing">
    <Grid Margin="5">
        <Grid.Resources>
            <Style TargetType="TextBox">
                <Setter Property="Margin" Value="5"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="FontFamily" Value="Consolas"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
            </Style>
            <Style TargetType="TextBlock">
                <Setter Property="Margin" Value="5"/>
                <Setter Property="FontSize" Value="14"/>
                <Setter Property="FontFamily" Value="Consolas"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>
            <Style TargetType="Button">
                <Setter Property="FontFamily" Value="Consolas"/>
                <Setter Property="Margin" Value="5"/>
            </Style>
            <Style TargetType="Label">
                <Setter Property="FontSize" Value="12"/>
                <Setter Property="FontFamily" Value="Consolas"/>
                <Setter Property="VerticalContentAlignment" Value="Bottom"/>
            </Style>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>

                <RowDefinition Height="30"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="35"/>
            </Grid.RowDefinitions>

            <Label Grid.Row="0" Grid.Column="0" Content="Input Tag: (定周期読み込みタグ)" BorderThickness="0,0,0,2" BorderBrush="#FFE5B8B7" Grid.ColumnSpan="2"/>
            <TextBlock x:Name="txtInputTAG" Grid.Row="1" Grid.Column="0" TextWrapping="Wrap" Text=""/>
            <TextBox x:Name="txtInput" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" Text="" IsReadOnly="True" HorizontalContentAlignment="Right" Background="#FFFFEFEF"/>

            <!-- 動作開始/終了ボタン -->
            <Grid Grid.Row="2" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="90"/>
                    <ColumnDefinition Width="90"/>
                </Grid.ColumnDefinitions>
                <Button x:Name="btnStart" Content="Start" Grid.Column="1" Click="BtnStart_Click" />
                <Button x:Name="btnStop" Content="Stop" Grid.Column="2" Click="BtnStop_Click" />
            </Grid>
        </Grid>

        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="200"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30"/>
                <RowDefinition Height="40"/>
                <RowDefinition Height="35"/>
            </Grid.RowDefinitions>

            <!-- TAG書き込み処理 -->
            <Label Grid.Row="0" Grid.Column="0" Content="Output Tag: (writeボタンによる書き込みタグ)" BorderThickness="0,0,0,2" BorderBrush="#FFE5B8B7" Grid.ColumnSpan="2"/>
            <TextBlock x:Name="txtOutputTAG" Grid.Row="1" Grid.Column="0" TextWrapping="Wrap" Text=""/>
            <TextBox x:Name="txtOutput" Grid.Row="1" Grid.Column="1" TextWrapping="Wrap" Text="0"  HorizontalContentAlignment="Right" Margin="5"/>

            <Grid Grid.Row="2" Grid.ColumnSpan="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="90"/>
                    <ColumnDefinition Width="90"/>
                </Grid.ColumnDefinitions>
                <Button x:Name="btnOutput" Content="write" Grid.Column="2" Click="BtnOutput_Click"/>
            </Grid>
        </Grid>

    </Grid>
</Window>
