public static View RenderAdaptiveCardWrapper(AdaptiveCard card, AdaptiveRenderContext context) { Grid grid = new Grid() { Style = context.GetStyle("Adaptive.Card"), BackgroundColor = context.GetColor(context.Config.ContainerStyles.Default.BackgroundColor) }; grid.SetBackgroundImage(card.BackgroundImage); Grid grid1 = new Grid() { Style = context.GetStyle("Adaptive.InnerCard"), //Margin = new Thickness((double)context.Config.Spacing.Padding) }; grid1.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) }); AdaptiveContainerRenderer.AddContainerElements(grid1, card.Body, context); AdaptiveActionSetRenderer.AddActions(grid1, card.Actions, context); grid.Children.Add(grid1); return(grid); }
public static View Render(AdaptiveContainer container, AdaptiveRenderContext context) { ContainerStyleConfig defaultConfig = context.Config.ContainerStyles.Default; Grid grid = new Grid() { Style = context.GetStyle("Adaptive.Container") }; AdaptiveContainerRenderer.AddContainerElements(grid, container.Items, context); if (container.SelectAction != null) { return(context.RenderSelectAction(container.SelectAction, grid)); } Grid grid1 = new Grid() { BackgroundColor = context.GetColor(defaultConfig.BackgroundColor) }; grid1.Children.Add(grid); return(grid1); }