C# WPF通过代码将段落添加到TableCell中
如何按代码将两个C# WPF通过代码将段落添加到TableCell中,c#,.net,wpf,C#,.net,Wpf,如何按代码将两个段落添加到表格单元格?在XAML中,它看起来像 <TableCell> <Paragraph>first</Paragraph> <Paragraph>second</Paragraph> </TableCell> 尝试添加到TableCell的块中 看看MSDN 理想情况下,它看起来像这样 TableCell firstCell = new TableCell(new Paragraph(
段落
添加到表格单元格
?在XAML中,它看起来像
<TableCell>
<Paragraph>first</Paragraph>
<Paragraph>second</Paragraph>
</TableCell>
尝试添加到TableCell的块中 看看MSDN 理想情况下,它看起来像这样
TableCell firstCell = new TableCell(new Paragraph(new Run("first")));
//I did not test this code
TableCell firstCell = new TableCell();
firstCell.Blocks.Add(new Paragraph(new Run("first")));
希望这是有帮助的 尝试添加到TableCell的块中 看看MSDN 理想情况下,它看起来像这样
TableCell firstCell = new TableCell(new Paragraph(new Run("first")));
//I did not test this code
TableCell firstCell = new TableCell();
firstCell.Blocks.Add(new Paragraph(new Run("first")));
希望这是有帮助的 谢谢!工作正常,谢谢!工作正常。