forked from ThunderDesign/ThunderDesign.Net-PCL.SQLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContactsView.xaml
More file actions
86 lines (86 loc) · 5.17 KB
/
ContactsView.xaml
File metadata and controls
86 lines (86 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?xml version="1.0" encoding="utf-8" ?>
<b:BaseView
xmlns:b="clr-namespace:SimpleContacts.Views.Base"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
Title="Contacts"
x:Class="SimpleContacts.Views.ContactsView"
x:TypeArguments="vm:ContactsViewModel"
xmlns:v="clr-namespace:SimpleContacts.Views"
xmlns:vm="clr-namespace:SimpleContacts.ViewModels"
xmlns:fab="clr-namespace:ThunderDesign.Xamarin.Forms.FloatingActionButton.Controls;assembly=ThunderDesign.Xamarin.Forms.FloatingActionButton">
<ContentPage.Content>
<RefreshView Command="{Binding Source={RelativeSource AncestorType={x:Type v:ContactsView}}, Path=RefreshViewCommand}" IsRefreshing="{Binding IsBusy, Mode=OneWay}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<CollectionView Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"
ItemsSource="{Binding .}"
BindingContext="{Binding Source={RelativeSource AncestorType={x:Type vm:ContactsViewModel}}, Path=ViewModelData}"
SelectionMode="None" ItemsUpdatingScrollMode="KeepScrollOffset">
<CollectionView.ItemsLayout>
<GridItemsLayout Span="1" Orientation="Vertical" />
</CollectionView.ItemsLayout>
<CollectionView.ItemTemplate>
<DataTemplate>
<ContentView Padding="2.5,10,2.5,10">
<Frame BorderColor="LightGray"
HasShadow="True"
CornerRadius="22"
BackgroundColor="LightBlue"
Style="{StaticResource FrameGradient}">
<SwipeView BackgroundColor="Transparent" BindingContext="{Binding Value}">
<SwipeView.GestureRecognizers>
<TapGestureRecognizer
NumberOfTapsRequired="1"
Command="{Binding Source={RelativeSource AncestorType={x:Type v:ContactsView}}, Path=ReviseViewCommandAsync}"
CommandParameter="{Binding .}">
</TapGestureRecognizer>
</SwipeView.GestureRecognizers>
<SwipeView.RightItems>
<SwipeItems Mode="Execute">
<SwipeItem Text="Delete"
IconImageSource="delete.png"
BackgroundColor="OrangeRed"
Command="{Binding Source={RelativeSource AncestorType={x:Type v:ContactsView}}, Path=DeleteViewCommandAsync}"
CommandParameter="{Binding .}" />
</SwipeItems>
</SwipeView.RightItems>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label
Grid.Column="0" Grid.Row="0"
Text="{Binding FullName}"
LineBreakMode="NoWrap"
Style="{StaticResource LabelTitle}"
Padding="15,10,5,10">
</Label>
</Grid>
</SwipeView>
</Frame>
</ContentView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
<fab:FloatingActionButton
Grid.Column="0" Grid.Row="1"
Text="+"
Style="{StaticResource RoundFAB}"
Command="{Binding Source={RelativeSource AncestorType={x:Type v:ContactsView}}, Path=CreateViewCommandAsync}"
VerticalOptions="End"
HorizontalOptions="End"
Margin="25"/>
</Grid>
</RefreshView>
</ContentPage.Content>
</b:BaseView>