0
是否有可能将System.Windows.Documents.Block
转换为System.Windows.UIElement
?块到UIElement转换
我需要这个,因为我想将我创建的块添加到固定文档。有没有其他方法?
是否有可能将System.Windows.Documents.Block
转换为System.Windows.UIElement
?块到UIElement转换
我需要这个,因为我想将我创建的块添加到固定文档。有没有其他方法?
如果有人仍然需要知道这一点,这很容易。
只需使用BlockUIElement来包含UIElement。
举例来说,如果你是一个Border元素附加到表的单元格:
TableCell的细胞=新的TableCell(新的边界()); //将无法使用! (新的BlockUIContainer(新的边界()));新的TableCell(new BlockUIContainer(new Border()));好!
这不是与OP想要的方式相反吗?你迪UIElement - > Block,他希望Block - > UIElement – FrieK 2011-10-17 12:51:56