private async Task CreateArticleView(ArticleModel articleModel) { var url = _settingsService.ArticlesEndpoint + "/elements/" + articleModel.Id; var articleElements = await _requestProvider.GetAsync <List <ArticleElement> >(url); var stackLayout = new StackLayout(); //Add Title var label = new Label { FontSize = 32, Text = articleModel.Title, FontFamily = _fontDependDevice.GetFont("Times New Roman Bold") }; stackLayout.Children.Add(label); //Add elements if (articleElements.Any()) { foreach (var element in articleElements) { switch (element.Type) { case ArticleElementType.Header: var header = new Label { FontSize = 22, Text = element.Content, FontFamily = _fontDependDevice.GetFont("Times New Roman Bold") }; stackLayout.Children.Add(header); break; case ArticleElementType.Paragraph: var paragraph = new Label { FontSize = 16, Text = element.Content, FontFamily = _fontDependDevice.GetFont("Times New Roman") }; stackLayout.Children.Add(paragraph); break; case ArticleElementType.Image: var builder = new UriBuilder(_settingsService.ApiEndpoint); builder.Path = "/" + element.Content; var image = await _requestProvider.GetImageAsync(builder.ToString()); stackLayout.Children.Add(image); break; } } } //Add link to add commend var addCommentLink = new Label { TextColor = Color.Blue, Text = "Ответить", Margin = new Thickness(0, 4, 0, 0) }; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.SetBinding(TapGestureRecognizer.CommandProperty, nameof(AddCommentToArticleCommand)); addCommentLink.GestureRecognizers.Add(tapGestureRecognizer); stackLayout.Children.Add(addCommentLink); var articleFrame = new Frame { Content = stackLayout, HasShadow = true, Margin = 5, BackgroundColor = Color.White }; ArticleView = articleFrame; }