Browse Source

Merge pull request #454 from thomasstevens89/main

Update DynamicOptimized Example to use non-deprecated methods
Marcin Ziąbek 2 years ago
parent
commit
c3c0d7631c
1 changed files with 13 additions and 13 deletions
  1. 13 13
      Source/QuestPDF.Examples/DynamicOptimizedExample.cs

+ 13 - 13
Source/QuestPDF.Examples/DynamicOptimizedExample.cs

@@ -50,15 +50,15 @@ namespace QuestPDF.Examples
             {
             {
                 container.MinimalBox().Decoration(decoration =>
                 container.MinimalBox().Decoration(decoration =>
                 {
                 {
-                    decoration.Header().Element(header);
+                    decoration.Before().Element(header);
 
 
-                    decoration.Content().Box().Stack(stack =>
+                    decoration.Content().Column(column =>
                     {
                     {
                         foreach (var row in rows)
                         foreach (var row in rows)
-                            stack.Item().Element(row.Element);
+                            column.Item().Element(row.Element);
                     });
                     });
 
 
-                    decoration.Footer().Element(footer);
+                    decoration.After().Element(footer);
                 });
                 });
             });
             });
 
 
@@ -83,15 +83,14 @@ namespace QuestPDF.Examples
                     .BorderBottom(1)
                     .BorderBottom(1)
                     .BorderColor(Colors.Grey.Darken2)
                     .BorderColor(Colors.Grey.Darken2)
                     .Padding(5)
                     .Padding(5)
+                    .DefaultTextStyle(TextStyle.Default.SemiBold())
                     .Row(row =>
                     .Row(row =>
                     {
                     {
-                        var textStyle = TextStyle.Default.SemiBold();
-
-                        row.ConstantItem(30).Text("#", textStyle);
-                        row.RelativeItem().Text("Item name", textStyle);
-                        row.ConstantItem(50).AlignRight().Text("Count", textStyle);
-                        row.ConstantItem(50).AlignRight().Text("Price", textStyle);
-                        row.ConstantItem(50).AlignRight().Text("Total", textStyle);
+                        row.ConstantItem(30).Text("#");
+                        row.RelativeItem().Text("Item name");
+                        row.ConstantItem(50).AlignRight().Text("Count");
+                        row.ConstantItem(50).AlignRight().Text("Price");
+                        row.ConstantItem(50).AlignRight().Text("Total");
                     });
                     });
             });
             });
         }
         }
@@ -106,7 +105,8 @@ namespace QuestPDF.Examples
                     .Width(context.AvailableSize.Width)
                     .Width(context.AvailableSize.Width)
                     .Padding(5)
                     .Padding(5)
                     .AlignRight()
                     .AlignRight()
-                    .Text($"Subtotal: {total}$", TextStyle.Default.Size(14).SemiBold());
+                    .DefaultTextStyle(TextStyle.Default.FontSize(14).SemiBold())
+                    .Text($"Subtotal: {total}$");
             });
             });
         }
         }
         
         
@@ -165,7 +165,7 @@ namespace QuestPDF.Examples
                         .Decoration(decoration =>
                         .Decoration(decoration =>
                         {
                         {
                             decoration
                             decoration
-                                .Header()
+                                .Before()
                                 .PaddingBottom(5)
                                 .PaddingBottom(5)
                                 .Text(text =>
                                 .Text(text =>
                                 {
                                 {