| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- <?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:ui="clr-namespace:XF.Material.Forms.UI;assembly=XF.Material"
- xmlns:local="clr-namespace:PRS.Mobile"
- xmlns:mobile="clr-namespace:InABox.Mobile;assembly=InABox.Mobile.Shared"
- x:Class="PRS.Mobile.ExistingForms">
-
- <ContentView.Resources>
- <local:ExistingFormStatusConverter x:Key="ExistingFormStatusConverter" />
- <local:ExistingFormBackgroundColorConverter x:Key="ExistingFormBackgroundColorConverter" />
- <local:ExistingFormForegroundColorConverter x:Key="ExistingFormForegroundColorConverter" />
- <mobile:DateTimeToBooleanConverter EmptyResult="False" x:Key="FormOpenConverter" />
- <mobile:DateTimeToBooleanConverter EmptyResult="True" x:Key="FormClosedConverter" />
- </ContentView.Resources>
-
- <ContentView.BindingContext>
- <local:ExistingFormsViewModel x:Name="_model" />
- </ContentView.BindingContext>
-
- <ContentView.Content>
- <Grid>
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="*"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
-
- <mobile:MobileSearchBar
- x:Name="_search"
- Grid.Row="0"
- PlaceHolder="Search"
- TextChanged="_search_OnTextChanged"/>
-
- <mobile:MobileList
- x:Name="_forms"
- Grid.Row="1"
- PullToRefresh="True"
- RefreshRequested="_digitalforms_OnRefresh"
- HasUnevenRows="True"
- ShowRecordCount="True">
-
- <mobile:MobileList.ItemTemplate>
-
- <DataTemplate x:DataType="local:IDigitalFormInstanceShell">
- <mobile:MobileCard
- HorizontalOptions="FillAndExpand"
- BackgroundColor="{Binding ., Converter={StaticResource ExistingFormBackgroundColorConverter}}"
- Clicked="Form_Clicked">
-
- <Grid Margin="2"
-
- RowSpacing="0"
- ColumnSpacing="0">
-
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto"/>
- <RowDefinition Height="Auto"/>
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="Auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="Auto"/>
- </Grid.ColumnDefinitions>
-
- <Image
- Grid.Row="0"
- Grid.Column="0"
- Grid.RowSpan="2"
- Margin="5"
- Source="digitalform"
- HeightRequest="40"
- WidthRequest="40"
- VerticalOptions="Center"
- HorizontalOptions="Center"/>
-
- <ui:MaterialLabel
- Grid.Row="0"
- Grid.Column="1"
- Grid.ColumnSpan="3"
- Text="{Binding FormDescription}"
- TypeScale="Subtitle2"
- HorizontalOptions="Fill"
- HorizontalTextAlignment="Start"
- VerticalOptions="Fill"
- VerticalTextAlignment="Center"
- LineHeight="1.0"
- Margin="0,5,0,5"
- TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
-
- <ui:MaterialLabel
- Grid.Row="1"
- Grid.Column="1"
- Text="{Binding ., Converter={StaticResource ExistingFormStatusConverter}}"
- IsVisible="{Binding Completed, Converter={StaticResource FormClosedConverter}}"
- TypeScale="Body2"
- HorizontalOptions="Fill"
- HorizontalTextAlignment="Start"
- VerticalOptions="Fill"
- VerticalTextAlignment="End"
- LineBreakMode="WordWrap"
- LineHeight="1.0"
- Margin="0"
- TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
-
- <ui:MaterialLabel
- Grid.Row="1"
- Grid.Column="1"
- Text="{Binding Completed, StringFormat='{}{0:dd MMMM yy}'}"
- IsVisible="{Binding Completed, Converter={StaticResource FormOpenConverter}}"
- TypeScale="Body2"
- HorizontalOptions="Fill"
- HorizontalTextAlignment="Start"
- VerticalOptions="Fill"
- VerticalTextAlignment="End"
- LineBreakMode="WordWrap"
- LineHeight="1.0"
- Margin="0"
- TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
-
-
- <ui:MaterialLabel
- Grid.Row="1"
- Grid.Column="3"
- Text="{Binding Number}"
- TypeScale="Body2"
- HorizontalOptions="Fill"
- HorizontalTextAlignment="Start"
- VerticalOptions="Fill"
- VerticalTextAlignment="End"
- LineBreakMode="WordWrap"
- LineHeight="1.0"
- Margin="0"
- TextColor="{Binding ., Converter={StaticResource ExistingFormForegroundColorConverter}}"/>
-
- </Grid>
- </mobile:MobileCard>
- </DataTemplate>
- </mobile:MobileList.ItemTemplate>
-
- </mobile:MobileList>
-
-
- <mobile:MobileTabStrip
- x:Name="_tabStrip"
- Grid.Row="2"
- CornerRadius="5"
- SelectionChanged="_tabStrip_OnSelectionChanged"
- IsVisible="{Binding SeparateHistory}">
- <mobile:MobileTabStrip.Items>
- <mobile:MobileTabStripItem Text="Open Forms"/>
- <mobile:MobileTabStripItem Text="History"/>
- </mobile:MobileTabStrip.Items>
- </mobile:MobileTabStrip>
-
- </Grid>
-
- </ContentView.Content>
-
- </ContentView>
|