示例#1
0
        public MainPage()
        {
            InitializeComponent();
            Resources.Add(StyleSheet.FromAssemblyResource(
                              typeof(MainPage).GetTypeInfo().Assembly,
                              "MixoLogy.Assets.styles.css"));

            _cocktails = Cocktail.LoadCocktailsCollection();
            CreateGrid(_cocktails);
            var button = new Button
            {
                Text              = "Load More",
                BackgroundColor   = Color.HotPink,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                Margin            = new Thickness(5, 5, 5, 40)
            };

            button.Clicked += LoadMore;
            stackLayout.Children.Add(button);
        }