MobileTimeButton.xaml 1.7 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. <material:MaterialCard
  13. x:Name="_frame"
  14. CornerRadius = "5"
  15. Elevation = "0"
  16. Margin = "2"
  17. HasShadow = "False"
  18. Padding = "{TemplateBinding Padding}"
  19. IsClickable = "True"
  20. IsEnabled="True"
  21. BackgroundColor="{TemplateBinding ButtonColor}"
  22. BorderColor="{TemplateBinding BorderColor}"
  23. Clicked="_frame_OnClicked">
  24. <material:MaterialLabel
  25. x:Name="_label"
  26. Text="{TemplateBinding Time, Converter={StaticResource TimeSpanFormatter}}"
  27. VerticalOptions="CenterAndExpand"
  28. HorizontalOptions="CenterAndExpand"
  29. TypeScale = "{TemplateBinding TypeScale}"
  30. HorizontalTextAlignment = "Center"
  31. TextColor="{TemplateBinding TextColor}"
  32. />
  33. </material:MaterialCard>
  34. </ControlTemplate>
  35. </ContentView.ControlTemplate>
  36. </ContentView>