Exemple #1
0
        public DemoLabel WithGestureRecognizer()
        {
            GestureRecognizers.Add(new TapGestureRecognizer {
                Command = new Command(o => App.ShowMessage("Success", Text + " tapped")),
            });

            return(this);
        }
Exemple #2
0
        public DemoButton(string text)
        {
            Text = text;

            BackgroundColor = Color.AliceBlue;

            Command = new Command(o => App.ShowMessage("Success", text + " tapped"));
        }
        public DemoListViewWithTextCell(ListViewCachingStrategy cachingStrategy) : base(cachingStrategy)
        {
            ItemsSource = new List <string> {
                "Item A1", "Item B1", "Item C1"
            };
            ItemTemplate = new DataTemplate(typeof(TextCell));

            BackgroundColor = Color.GhostWhite;

            ItemTemplate.SetBinding(TextCell.TextProperty, ".");
            ItemTapped += (sender, e) => App.ShowMessage("Success", e.Item + " tapped");
        }
Exemple #4
0
        public DemoListViewWithStringViewCell(ListViewCachingStrategy cachingStrategy) : base(cachingStrategy)
        {
            ItemsSource = new List <string> {
                "Item A2", "Item B2", "Item C2"
            };
            ItemTemplate = new DataTemplate(typeof(StringDemoCell));

            BackgroundColor = Color.GhostWhite;
            HeightRequest   = 200;

            ItemTapped += (sender, e) => App.ShowMessage("Success", e.Item + " tapped");
        }
Exemple #5
0
        public DemoStack()
        {
            Children.Add(new DemoLabel("label in tap-able layout"));
            AutomationId = "tappable-stack";

            BackgroundColor = Color.Gray.MultiplyAlpha(0.2);
            Padding         = 10;

            GestureRecognizers.Add(new TapGestureRecognizer {
                Command = new Command(o => App.ShowMessage("Success", "StackLayout tapped")),
            });
        }
Exemple #6
0
        public DemoListViewWithGroupsAndHeaderTemplate(ListViewCachingStrategy cachingStrategy) : base(cachingStrategy)
        {
            ItemsSource = new List <List <string> > {
                new StringGroup(new [] { "A6", "B6", "C6" }, "Group 6"),
                new StringGroup(new [] { "A7", "B7", "C7" }, "Group 7"),
            };
            ItemTemplate        = new DataTemplate(typeof(StringDemoCell));
            IsGroupingEnabled   = true;
            GroupHeaderTemplate = new DataTemplate(typeof(GroupHeaderCell));
            BackgroundColor     = Color.GhostWhite;

            ItemTapped += (sender, e) => App.ShowMessage("Success", (e.Item as string) + " tapped");
        }
        public DemoListViewWithGestureRecognizers(ListViewCachingStrategy cachingStrategy) : base(cachingStrategy)
        {
            ItemsSource = new List <Item> {
                new Item {
                    Name = "Item"
                }
            };
            ItemTemplate = new DataTemplate(typeof(ItemGestureCell));

            BackgroundColor = Color.GhostWhite;

            ItemTapped += (sender, e) => App.ShowMessage("ListView Cell", (e.Item as Item).Name + " tapped");
        }
        public DemoListViewWithGroups(ListViewCachingStrategy cachingStrategy) : base(cachingStrategy)
        {
            ItemsSource = new List <List <string> > {
                new StringGroup(new [] { "A4", "B4", "C4" }, "Group 4"),
                new StringGroup(new [] { "A5", "B5", "C5" }, "Group 5"),
            };
            ItemTemplate        = new DataTemplate(typeof(StringDemoCell));
            IsGroupingEnabled   = true;
            GroupDisplayBinding = new Binding(nameof(StringGroup.Title));

            BackgroundColor = Color.GhostWhite;

            ItemTapped += (sender, e) => App.ShowMessage("Success", (e.Item as string) + " tapped");
        }
Exemple #9
0
        public DemoListViewWithItemViewCell(ListViewCachingStrategy cachingStrategy) : base(cachingStrategy)
        {
            ItemsSource = new List <Item> {
                new Item {
                    Name = "Item A3"
                }, new Item {
                    Name = "Item B3"
                }, new Item {
                    Name = "Item C3"
                }
            };
            ItemTemplate = new DataTemplate(typeof(ItemDemoCell));

            BackgroundColor = Color.GhostWhite;

            ItemTapped += (sender, e) => App.ShowMessage("Success", (e.Item as Item).Name + " tapped");
        }
Exemple #10
0
 public DemoToolbarItem()
 {
     Text    = "ToolbarItem";
     Command = new Command(o => App.ShowMessage("Success", Text + " tapped"));
 }