<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms" 
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Borepin.View.MachineListItemView"
             xmlns:converters="clr-namespace:Borepin.Converter">
    <ContentView.Resources>
        <ResourceDictionary>
            <converters:MachineStateColorConverter x:Key="MachineStateColorConverter"/>
            <converters:MachineStateStringConverter x:Key="MachineStateStringConverter"/>
        </ResourceDictionary>
    </ContentView.Resources>
  <ContentView.Content>
        <Grid RowSpacing="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="5" />
                <ColumnDefinition Width="6*" />
                <ColumnDefinition Width="3*" />
                <ColumnDefinition Width="2*" />
                <ColumnDefinition Width="1" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="1"/>
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Grid.Column="1" Text="{Binding Machine.Name}" Style="{StaticResource LabelStyle_Primary}"/>
            <StackLayout Grid.Row="0" Grid.Column="2" Orientation="Horizontal" HorizontalOptions="End">
                <Label Text="{Binding Machine.State, Converter={StaticResource MachineStateStringConverter}}" TextColor="{Binding Machine.State, Converter={StaticResource MachineStateColorConverter}}" Style="{StaticResource LabelStyle_Second}"/>
                <Label Text="by Me" IsVisible="{Binding IsInUseByMe}" Style="{StaticResource LabelStyle_Second}"/>
            </StackLayout>
            <Button Grid.Row="0" Grid.Column="3" Margin="0, 3, 0, 3" Text="➔" Command="{Binding SelectInstanceCommand}" Style="{StaticResource Style_Button_Primary}"/>
            <BoxView Grid.Row="1" Grid.ColumnSpan="5" BackgroundColor="{StaticResource FifthColor}"/>
        </Grid>
    </ContentView.Content>
</ContentView>