ExistingForms.xaml 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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:ui="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
  5. xmlns:local="clr-namespace:PRS.Mobile"
  6. xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
  7. x:Class="PRS.Mobile.ExistingForms">
  8. <ContentView.Resources>
  9. <local:ExistingFormStatusConverter x:Key="ExistingFormStatusConverter" />
  10. <local:ExistingFormBackgroundColorConverter x:Key="ExistingFormBackgroundColorConverter" />
  11. <local:ExistingFormForegroundColorConverter x:Key="ExistingFormForegroundColorConverter" />
  12. <mobile:DateTimeToBooleanConverter EmptyResult="False" x:Key="FormOpenConverter" />
  13. <mobile:DateTimeToBooleanConverter EmptyResult="True" x:Key="FormClosedConverter" />
  14. </ContentView.Resources>
  15. <ContentView.BindingContext>
  16. <local:ExistingFormsViewModel x:Name="_model" />
  17. </ContentView.BindingContext>
  18. <ContentView.Content>
  19. <Grid>
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="Auto"/>
  22. <RowDefinition Height="*"/>
  23. <RowDefinition Height="Auto"/>
  24. </Grid.RowDefinitions>
  25. <mobile:MobileSearchBar
  26. x:Name="_search"
  27. Grid.Row="0"
  28. PlaceHolder="Search"
  29. TextChanged="_search_OnTextChanged"/>
  30. <mobile:MobileList
  31. x:Name="_forms"
  32. Grid.Row="1"
  33. PullToRefresh="True"
  34. RefreshRequested="_digitalforms_OnRefresh"
  35. HasUnevenRows="True"
  36. ShowRecordCount="True">
  37. <mobile:MobileList.ItemTemplate>
  38. <DataTemplate x:DataType="local:IDigitalFormInstanceShell">
  39. <mobile:MobileCard
  40. HorizontalOptions="FillAndExpand"
  41. BackgroundColor="{Binding ., Converter={StaticResource ExistingFormBackgroundColorConverter}}"
  42. Clicked="Form_Clicked">
  43. <Grid Margin="2"
  44. RowSpacing="0"
  45. ColumnSpacing="0">
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="Auto"/>
  48. <RowDefinition Height="Auto"/>
  49. </Grid.RowDefinitions>
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="Auto"/>
  52. <ColumnDefinition Width="Auto"/>
  53. <ColumnDefinition Width="*"/>
  54. <ColumnDefinition Width="Auto"/>
  55. </Grid.ColumnDefinitions>
  56. <Image
  57. Grid.Row="0"
  58. Grid.Column="0"
  59. Grid.RowSpan="2"
  60. Margin="5"
  61. Source="digitalform"
  62. HeightRequest="40"
  63. WidthRequest="40"
  64. VerticalOptions="Center"
  65. HorizontalOptions="Center"/>
  66. <ui:MaterialLabel
  67. Grid.Row="0"
  68. Grid.Column="1"
  69. Grid.ColumnSpan="3"
  70. Text="{Binding FormDescription}"
  71. TypeScale="Subtitle2"
  72. HorizontalOptions="Fill"
  73. HorizontalTextAlignment="Start"
  74. VerticalOptions="Fill"
  75. VerticalTextAlignment="Center"
  76. LineHeight="1.0"
  77. Margin="0,5,0,5"
  78. TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
  79. <ui:MaterialLabel
  80. Grid.Row="1"
  81. Grid.Column="1"
  82. Text="{Binding ., Converter={StaticResource ExistingFormStatusConverter}}"
  83. IsVisible="{Binding Completed, Converter={StaticResource FormClosedConverter}}"
  84. TypeScale="Body2"
  85. HorizontalOptions="Fill"
  86. HorizontalTextAlignment="Start"
  87. VerticalOptions="Fill"
  88. VerticalTextAlignment="End"
  89. LineBreakMode="WordWrap"
  90. LineHeight="1.0"
  91. Margin="0"
  92. TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
  93. <ui:MaterialLabel
  94. Grid.Row="1"
  95. Grid.Column="1"
  96. Text="{Binding Completed, StringFormat='{}{0:dd MMMM yy}'}"
  97. IsVisible="{Binding Completed, Converter={StaticResource FormOpenConverter}}"
  98. TypeScale="Body2"
  99. HorizontalOptions="Fill"
  100. HorizontalTextAlignment="Start"
  101. VerticalOptions="Fill"
  102. VerticalTextAlignment="End"
  103. LineBreakMode="WordWrap"
  104. LineHeight="1.0"
  105. Margin="0"
  106. TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
  107. <ui:MaterialLabel
  108. Grid.Row="1"
  109. Grid.Column="3"
  110. Text="{Binding Number}"
  111. TypeScale="Body2"
  112. HorizontalOptions="Fill"
  113. HorizontalTextAlignment="Start"
  114. VerticalOptions="Fill"
  115. VerticalTextAlignment="End"
  116. LineBreakMode="WordWrap"
  117. LineHeight="1.0"
  118. Margin="0"
  119. TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
  120. </Grid>
  121. </mobile:MobileCard>
  122. </DataTemplate>
  123. </mobile:MobileList.ItemTemplate>
  124. </mobile:MobileList>
  125. <mobile:MobileTabStrip
  126. x:Name="_tabStrip"
  127. Grid.Row="2"
  128. CornerRadius="5"
  129. SelectionChanged="_tabStrip_OnSelectionChanged"
  130. IsVisible="{Binding SeparateHistory}">
  131. <mobile:MobileTabStrip.Items>
  132. <mobile:MobileTabStripItem Text="Open Forms"/>
  133. <mobile:MobileTabStripItem Text="History"/>
  134. </mobile:MobileTabStrip.Items>
  135. </mobile:MobileTabStrip>
  136. </Grid>
  137. </ContentView.Content>
  138. </ContentView>