MobileCheckBox.xaml 997 B

12345678910111213141516171819202122
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <ContentView xmlns="http://xamarin.com/schemas/2014/forms"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  4. xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
  5. x:Class="InABox.Mobile.MobileCheckBox">
  6. <ContentView.Resources>
  7. <mobile:BooleanToImageConverter x:Key="CheckBoxImageConverter" Checked="checked" Unchecked="unchecked"/>
  8. </ContentView.Resources>
  9. <ContentView.ControlTemplate>
  10. <ControlTemplate >
  11. <Grid BindingContext="{TemplateBinding BindingContext.DataContext}">
  12. <ImageButton
  13. Source="{TemplateBinding IsChecked, Converter={StaticResource CheckBoxImageConverter}}"
  14. Clicked="ToggleCheck"
  15. HeightRequest="30"
  16. WidthRequest="30"
  17. />
  18. </Grid>
  19. </ControlTemplate>
  20. </ContentView.ControlTemplate>
  21. </ContentView>