private void CreateUI() { var gridLayout = CreateGridLayout(); var articleBox = new MainPageHubItem(_translation.Articles, _tileGrayColor, new Command(async () => await Navigation.PushAsync(_viewLocator.ArticleMasterPage))); var galleryBox = new MainPageHubItem(_translation.Gallery, _tileLightBlueColor, new Command(async () => await Navigation.PushAsync(_viewLocator.GalleryPage))); var logBox = new MainPageHubItem(_translation.Logs, _tileDarkBlueColor, new Command(() => {})); var statisticBox = new MainPageHubItem(_translation.Statistics, _tileGrayColor, new Command(async () => { await Navigation.PushAsync(_viewLocator.StatisticsPage); })); var infoBox = new MainPageHubItem(_translation.Info, _tileInfoColor, new Command(async () => await Navigation.PushAsync(_viewLocator.InfoPage)), Color.Black); AddHubItemToGrid(gridLayout, articleBox, 0, 0); AddHubItemToGrid(gridLayout, galleryBox, 0, 1); AddHubItemToGrid(gridLayout, logBox, 1, 0); AddHubItemToGrid(gridLayout, statisticBox, 1, 1); AddHubItemToGrid(gridLayout, infoBox, 2, 0); SetScrollViewContent(gridLayout); }
private void AddHubItemToGrid(Grid grid, MainPageHubItem item, int row, int column) { grid.Children.Add(item.BoxView, column, row); grid.Children.Add(item.Label, column, row); }