Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/320.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF通过代码将段落添加到TableCell中_C#_.net_Wpf - Fatal编程技术网

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")));

希望这是有帮助的

谢谢!工作正常,谢谢!工作正常。