-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
NoIconTextSwipeItemGallery.cs
58 lines (47 loc) · 1.14 KB
/
NoIconTextSwipeItemGallery.cs
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
using System;
namespace Xamarin.Forms.Controls.GalleryPages.SwipeViewGalleries
{
public class NoIconTextSwipeItemGallery : ContentPage
{
public NoIconTextSwipeItemGallery()
{
Title = "No Icon or Text SwipeItem Gallery";
var swipeLayout = new StackLayout
{
Margin = new Thickness(12)
};
var noIconSwipeItem = new SwipeItem
{
BackgroundColor = Color.Red,
Text = "File"
};
var noTextSwipeItem = new SwipeItem
{
BackgroundColor = Color.BlueViolet,
IconImageSource = "calculator.png"
};
var swipeItems = new SwipeItems { noIconSwipeItem, noTextSwipeItem };
swipeItems.Mode = SwipeMode.Reveal;
var swipeContent = new Grid
{
BackgroundColor = Color.Gray
};
var swipeLabel = new Label
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center,
Text = "Swipe to Right (File)"
};
swipeContent.Children.Add(swipeLabel);
var swipeView = new SwipeView
{
HeightRequest = 60,
WidthRequest = 300,
LeftItems = swipeItems,
Content = swipeContent
};
swipeLayout.Children.Add(swipeView);
Content = swipeLayout;
}
}
}