<Page
  x:Class="Demo.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="using:Demo"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d">
  <Page.DataContext>
    <local:Demo x:Name="demo" HubURL="usb" Target="any" RequestedState="On" Channel="1" />
  </Page.DataContext>
  <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="16">
    <Grid.RowDefinitions>
      <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="*" />
    </Grid.ColumnDefinitions>

    <TextBlock Grid.Row="0" Grid.Column="0" Text="Hub URL:" Margin="10" HorizontalAlignment="Right" />
    <TextBox Grid.Row="0" Grid.Column="1" Margin="10" TextWrapping="Wrap" Text="{Binding HubURL,Mode=TwoWay}"
             VerticalAlignment="Center" />

    <TextBlock Grid.Row="1" Grid.Column="0" Text="Target:" Margin="10" HorizontalAlignment="Right" />
    <TextBox Grid.Row="1" Grid.Column="1" Margin="10" TextWrapping="Wrap" PlaceholderText="YCTOPOC1-00000"
             Text="{Binding Target,Mode=TwoWay}" VerticalAlignment="Center" />

    <TextBlock Grid.Row="2" Grid.Column="0" Text="Channel:" Margin="10" HorizontalAlignment="Right" />
    <StackPanel Grid.Row="2" Grid.Column="1" Margin="10" >

      <TextBox TextWrapping="Wrap" PlaceholderText="1"
               Text="{Binding Channel,Mode=TwoWay}" />
      <TextBlock Text="Number beteween 1 and 8" />
    </StackPanel>

    <TextBlock Grid.Row="3" Grid.Column="0" Text="State:" Margin="10" HorizontalAlignment="Right" />
    <StackPanel Grid.Row="3" Grid.Column="1" Margin="10" >

      <TextBox TextWrapping="Wrap" PlaceholderText="On"
               Text="{Binding RequestedState,Mode=TwoWay}" />
      <TextBlock Text="On or Off" />
    </StackPanel>

    <Button Grid.Row="4" Grid.Column="1" x:Name="button" Content="Start" Margin="10" Click="button_Click" />
    <TextBlock Grid.Row="5" Grid.Column="0" Text="Output:" HorizontalAlignment="Right" VerticalAlignment="Top"
               Margin="0,10,0,0" />
    <ScrollViewer Grid.Row="5" Grid.Column="1">
      <TextBox x:Name="textBlock" TextWrapping="Wrap" Text="{Binding Output,Mode=TwoWay}" Margin="10"
               IsReadOnly="True" />
    </ScrollViewer>
  </Grid>
</Page>