MobileTimeButton.xaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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:material="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
  5. xmlns:local="clr-namespace:InABox.Mobile"
  6. x:Class="InABox.Mobile.MobileTimeButton">
  7. <ContentView.Resources>
  8. <local:TimeSpanFormatter x:Key="TimeSpanFormatter"/>
  9. </ContentView.Resources>
  10. <ContentView.ControlTemplate>
  11. <ControlTemplate>
  12. <local:MobileCard
  13. x:Name="_frame"
  14. Padding = "{TemplateBinding Padding}"
  15. IsEnabled="True"
  16. BackgroundColor="{TemplateBinding ButtonColor}"
  17. BorderColor="{TemplateBinding BorderColor}"
  18. Clicked="_frame_OnClicked">
  19. <material:MaterialLabel
  20. x:Name="_label"
  21. Text="{TemplateBinding Time, Converter={StaticResource TimeSpanFormatter}}"
  22. VerticalOptions="CenterAndExpand"
  23. HorizontalOptions="CenterAndExpand"
  24. TypeScale = "{TemplateBinding TypeScale}"
  25. HorizontalTextAlignment = "Center"
  26. TextColor="{TemplateBinding TextColor}"
  27. />
  28. </local:MobileCard>
  29. </ControlTemplate>
  30. </ContentView.ControlTemplate>
  31. </ContentView>