<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="LabResults.MainPage" mc:Ignorable="d" FontSize="16" d:DesignHeight="300" d:DesignWidth="600" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.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:LabResults">

    <UserControl.Resources>
        <local:ViewModel x:Key="_vm" />
    </UserControl.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White" DataContext="{StaticResource _vm}">
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Horizontal" Margin="12">
            <TextBlock Text="Patient: " VerticalAlignment="Center" />
            <ComboBox ItemsSource="{Binding Patients}" SelectedItem="{Binding SelectedPatient, Mode=TwoWay}" Width="200" />
            <TextBlock Text="{Binding Patients.Count, StringFormat=' # of clients: {0}'}" VerticalAlignment="Center" />
        </StackPanel>

        <c1:C1FlexGrid ItemsSource="{Binding TestResults}" AutoGenerateColumns="False" RowBackground="Transparent" AlternatingRowBackground="Transparent" Grid.Row="1">
            <c1:C1FlexGrid.Columns>
                <c1:Column Binding="{Binding TestName}" Header="Test Name" Width="*" />
                <c1:Column Binding="{Binding Result, Mode=TwoWay}" Header="Test Results" Width="*" />
                <c1:Column Binding="{Binding Corrected, Mode=TwoWay}" Header="Corrected" Width=".5*" />
            </c1:C1FlexGrid.Columns>
        </c1:C1FlexGrid>
    </Grid>
</UserControl>