|
@@ -119,14 +119,6 @@ namespace QuestPDF.Fluent
|
|
|
Text = text ?? string.Empty
|
|
Text = text ?? string.Empty
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public static IContainer ShowWhen(this IContainer element, Predicate<ShowWhenContext> predicate)
|
|
|
|
|
- {
|
|
|
|
|
- return element.Element(new ShowWhen
|
|
|
|
|
- {
|
|
|
|
|
- VisibilityPredicate = predicate
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// If the container spans multiple pages, its content appears only on the first one.
|
|
/// If the container spans multiple pages, its content appears only on the first one.
|
|
@@ -283,7 +275,7 @@ namespace QuestPDF.Fluent
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
- /// Conditionally draws or hides its content.
|
|
|
|
|
|
|
+ /// Conditionally draws or hides its inner content.
|
|
|
/// <a href="https://www.questpdf.com/api-reference/show-if.html">Learn more</a>
|
|
/// <a href="https://www.questpdf.com/api-reference/show-if.html">Learn more</a>
|
|
|
/// </summary>
|
|
/// </summary>
|
|
|
/// <param name="condition">If the value is <see langword="true"/>, its content is visible. Otherwise, it's hidden.</param>
|
|
/// <param name="condition">If the value is <see langword="true"/>, its content is visible. Otherwise, it's hidden.</param>
|
|
@@ -292,6 +284,20 @@ namespace QuestPDF.Fluent
|
|
|
return condition ? element : new Container();
|
|
return condition ? element : new Container();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
|
+ /// Conditionally draws or hides its inner content depending on drawing context.
|
|
|
|
|
+ /// Please use carefully as certain predicates may produce unstable layouts resulting with unexpected content or exceptions.
|
|
|
|
|
+ /// <a href="https://www.questpdf.com/api-reference/show-if.html">Learn more</a>
|
|
|
|
|
+ /// </summary>
|
|
|
|
|
+ /// <param name="predicate">If the predicate returns <see langword="true"/>, its content is visible. Otherwise, it's hidden.</param>
|
|
|
|
|
+ public static IContainer ShowIf(this IContainer element, Predicate<ShowIfContext> predicate)
|
|
|
|
|
+ {
|
|
|
|
|
+ return element.Element(new ShowIf
|
|
|
|
|
+ {
|
|
|
|
|
+ VisibilityPredicate = predicate
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/// <summary>
|
|
/// <summary>
|
|
|
/// Provides direct access to the low-level SkiaSharp API.
|
|
/// Provides direct access to the low-level SkiaSharp API.
|
|
|
/// <a href="https://www.questpdf.com/api-reference/canvas.html">Learn more</a>
|
|
/// <a href="https://www.questpdf.com/api-reference/canvas.html">Learn more</a>
|