Selaa lähdekoodia

RTL: grid (example)

MarcinZiabek 3 vuotta sitten
vanhempi
sitoutus
e1ae97d3ca
1 muutettua tiedostoa jossa 28 lisäystä ja 1 poistoa
  1. 28 1
      QuestPDF.Examples/RightToLeftExamples.cs

+ 28 - 1
QuestPDF.Examples/RightToLeftExamples.cs

@@ -1,4 +1,5 @@
-using NUnit.Framework;
+using System.Linq;
+using NUnit.Framework;
 using QuestPDF.Elements;
 using QuestPDF.Elements;
 using QuestPDF.Examples.Engine;
 using QuestPDF.Examples.Engine;
 using QuestPDF.Fluent;
 using QuestPDF.Fluent;
@@ -186,5 +187,31 @@ namespace QuestPDF.Examples
                 };
                 };
             }
             }
         }
         }
+        
+        [Test]
+        public void Grid()
+        {
+            RenderingTest
+                .Create()
+                .ProduceImages()
+                .PageSize(600, 600)
+                .ShowResults()
+                .Render(container =>
+                {
+                    container
+                        .Padding(25)
+                        .Border(1)
+                        .ContentFromRightToLeft()
+                        .Grid(grid =>
+                        {
+                            grid.Spacing(25);
+                            
+                            foreach (var i in Enumerable.Range(1, 6))
+                            {
+                                grid.Item(i).Background(Placeholders.BackgroundColor()).Height(100);
+                            }
+                        });
+                });
+        }
     }
     }
 }
 }