CellProps.VerticalAlignments debug

This commit is contained in:
melekhin
2026-10-05 14:26:07 +07:00
parent e4ce91c53f
commit 690c7d4f13
+13 -2
View File
@@ -3,7 +3,7 @@
public readonly struct CellProps(double? width = null!) public readonly struct CellProps(double? width = null!)
{ {
public double? Width { get; init; } = width; public double? Width { get; init; } = width;
public TableVerticalAlignmentValues? VerticalAlignment { get; init; } = default; public VerticalAlignments? VerticalAlignment { get; init; } = default;
public MergedCell? Merge { get; init; } = default; public MergedCell? Merge { get; init; } = default;
public TextDirection TextDirection { get; init; } = TextDirection.LeftToRight; public TextDirection TextDirection { get; init; } = TextDirection.LeftToRight;
@@ -24,7 +24,16 @@ public readonly struct CellProps(double? width = null!)
{ {
list = list =
[ [
new TableCellVerticalAlignment() { Val = VerticalAlignment ?? TableVerticalAlignmentValues.Center }, new TableCellVerticalAlignment()
{
Val = (VerticalAlignment ?? VerticalAlignments.Center) switch
{
VerticalAlignments.Top => TableVerticalAlignmentValues.Top,
VerticalAlignments.Center => TableVerticalAlignmentValues.Center,
VerticalAlignments.Bottom => TableVerticalAlignmentValues.Bottom,
_ => throw new NotImplementedException(),
}
},
new TableCellMargin() new TableCellMargin()
{ {
TopMargin = new TopMargin() { Width = "0" }, TopMargin = new TopMargin() { Width = "0" },
@@ -111,3 +120,5 @@ public enum TextDirection
/// <summary> ⇓ ⇓ ⇓ Сверху вниз </summary> /// <summary> ⇓ ⇓ ⇓ Сверху вниз </summary>
TopToBottom, TopToBottom,
} }
public enum VerticalAlignments { Top, Center, Bottom }