-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
RefreshLayoutMarginGallery.xaml
69 lines (67 loc) · 2.55 KB
/
RefreshLayoutMarginGallery.xaml
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
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Xamarin.Forms.Controls.GalleryPages.RefreshViewGalleries.RefreshLayoutMarginGallery"
Title="RefreshView using margins Gallery">
<ContentPage.Resources>
<ResourceDictionary>
<DataTemplate x:Key="RefreshItemTemplate">
<Grid
HeightRequest="120"
WidthRequest="120">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<BoxView
Grid.Row="0"
Color="{Binding Color}"/>
<Label
Grid.Row="1"
Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ResourceDictionary>
</ContentPage.Resources>
<ContentPage.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<RefreshView
Grid.Row="0"
IsRefreshing="{Binding IsRefreshing}"
RefreshColor="Red"
BackgroundColor="Green"
Command="{Binding RefreshCommand}"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
<ScrollView
x:Name="RefreshScroll"
BackgroundColor="Yellow"
Margin="24">
<FlexLayout
Direction="Row"
Wrap="Wrap"
AlignItems="Stretch"
AlignContent="Start"
BindableLayout.ItemsSource="{Binding Items}"
BindableLayout.ItemTemplate="{StaticResource RefreshItemTemplate}"/>
</ScrollView>
</RefreshView>
<Grid
Grid.Row="1">
<Slider
MinimumTrackColor="LightGray"
MaximumTrackColor="Gray"
ThumbColor="DarkGray"
Minimum="0"
Maximum="60"
Value="24"
ValueChanged="OnMarginValueChanged"/>
</Grid>
</Grid>
</ContentPage.Content>
</ContentPage>