<?xml version="1.0" encoding="utf-8"?>

<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
             x:Class="InABox.Mobile.MobileCheckBox">
    <ContentView.Resources>
        <mobile:BooleanToImageConverter x:Key="CheckBoxImageConverter" Checked="checked" Unchecked="unchecked"/>
    </ContentView.Resources>
    <ContentView.ControlTemplate>
        <ControlTemplate >
            <Grid BindingContext="{TemplateBinding BindingContext.DataContext}">
                <ImageButton 
                    Source="{TemplateBinding IsChecked, Converter={StaticResource CheckBoxImageConverter}}" 
                    Clicked="ToggleCheck" 
                    HeightRequest="30"
                    WidthRequest="30"
                  />   
            </Grid>
        </ControlTemplate>
    </ContentView.ControlTemplate>
</ContentView>